Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 2.62 KB

search-sources.md

File metadata and controls

54 lines (39 loc) · 2.62 KB

Search sources

The best way to search for sources is to use the search query parameter, which searches across display_name, alternate_titles, and abbreviated_title. Example:

{% hint style="info" %} You can read more about search here. It will show you how relevance score is calculated, how words are stemmed to improve search results, and how to do complex boolean searches. {% endhint %}

Search a specific field

You can also use search as a filter, allowing you to fine-tune the fields you're searching over. To do this, you append .search to the end of the property you are filtering for:

The following fields can be searched as a filter within sources:

Search filter Field that is searched
display_name.search display_name

You can also use the filter default.search, which works the same as using the search parameter.

Autocomplete sources

You can autocomplete sources to create a very fast type-ahead style search function:

This returns a list of sources with the publisher set as the hint:

{ 
  "results": [
    {
        "id": "https://openalex.org/S5555990",
        "display_name": "The Journal of Neuroscience",
        "hint": "Society for Neuroscience",
        "cited_by_count": 4274712,
        "works_count": 40376,
        "entity_type": "source",
        "external_id": "0270-6474"
    },
    // more results
  ]
}

{% hint style="info" %} Read more in the autocomplete page in the API guide. {% endhint %}