multi-term search of the API

73 views
Skip to first unread message

Sol Lederman

unread,
Jan 19, 2023, 4:50:22 PM1/19/23
to OpenAlex users
Hi,

I've run some queries against the OpenAlex API using the "search" parameter and pipes between words and I generally get back results which are relevant to my query so I believe I understand how to do multi-term queries.

But, this query, which should match W1775749144 | OpenAlex Web, returns no results.


What am I missing?

Thanks!
Sol

Sol Lederman

unread,
Jan 20, 2023, 3:06:59 PM1/20/23
to OpenAlex users
Interestingly enough, this query returns what I expect, especially since I want to do a title search:

https://api.openalex.org/works?filter=title.search:PROTEIN|MEASUREMENT|WITH|THE|FOLIN|PHENOL|REAGENT

Am still wondering why the non-filter form the query doesn't return any results.

Sol



Casey Meyer

unread,
Jan 24, 2023, 5:31:51 AM1/24/23
to OpenAlex users
Hi Sol,

We will update our documentation to clearly show which search features are supported.

Technically we do not support search with OR pipes when using full search (search=frogs) or filter searches (filter=title.search:frogs). However, what you experienced is accurate, because when doing a full search the OR pipe has no effect and those pipes are removed. When searching with a filter, the OR pipes work to divide up the search into multiple searches. That's unintended, but it's a side effect of how we implemented the OR pipe to work with all filters.

We want to add more ways to search using OR, NOT operators, etc. But we need to think through it carefully and test it out. Hope that clears things up! Feel free to use the OR pipes within filter searches for now, as we would likely change that once we roll something else out.

Thanks,
Casey

Steve Eichert

unread,
Apr 17, 2023, 9:37:25 AM4/17/23
to OpenAlex users
Is the current recommendation to run independent searches based on each variation of a search term that would traditionally be "OR'd" together?  PubMed currently supports pretty advanced query capabilities and I'm looking for options to translate them to the OpenAlex dataset.  I often use multiple terms with OR's to cover different variations in how terms are represented in the literature.
Reply all
Reply to author
Forward
0 new messages