Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 2.82 KB

search-concepts.md

File metadata and controls

54 lines (39 loc) · 2.82 KB

Search concepts

The best way to search for concepts is to use the search query parameter, which searches the display_name and description fields. 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 field can be searched as a filter within concepts:

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 concepts

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

This returns a list of concepts with the description set as the hint:

{ 
  "results": [
    {
        "id": "https://openalex.org/C41008148",
        "display_name": "Computer science",
        "hint": "theoretical study of the formal foundation enabling the automated processing or computation of information, for example on a computer or over a data transmission network",
        "cited_by_count": 392939277,
        "works_count": 76722605,
        "entity_type": "concept",
        "external_id": "https://www.wikidata.org/wiki/Q21198"
    },
    ...
  ]
}

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