Open fiendish opened 6 years ago
^5, ^3 etc are syntax for applying boosts for certain fields when calculating the overall document score [1] e.g. boost label matches over synonyms. We have chosen what we think are a good default set of boosts when searching ontologies (based on user testing and feedback), but when you override the query fields in your example in [0] you won't get any boosts. We'll add something to the docs about boosts and how you can manipulate them in your own queries.
See also RT ticket https://helpdesk.ebi.ac.uk/Ticket/Display.html?id=331190.
The doc for queryFields at https://www.ebi.ac.uk/ols/docs/api#_search_parameters says
Specifcy the fields to query, the defaults are {label, synonym, description, short_form, obo_id, annotations, logical_description, iri}
Aside from the typo in Specify, those are not the actual defaults, and those values lead to bad results.
https://github.com/EBISPOT/OLS/blob/09e1351d7aa7411d316ccbbefa45bb96ff6bf711/ols-web/src/main/java/uk/ac/ebi/spot/ols/controller/api/SearchController.java#L120 shows the defaults to be
"label^5 synonym^3 description short_form^2 obo_id^2 annotations logical_description iri"
. These caret suffixes (^5, ^3, etc) seem to make a difference[0] but are not documented anywhere that I found.[0] - e.g. https://www.ebi.ac.uk/ols/api/search?q=Abnormal+Abdominal+Situs&start=0&type=class&ontology=hp&queryFields=label^5,synonym^3,description,short_form^2,obo_id^2,logical_description,iri gives
"Abnormality of abdominal situs"
as the first result, but https://www.ebi.ac.uk/ols/api/search?q=Abnormal+Abdominal+Situs&start=0&type=class&ontology=hp&queryFields=label,synonym,description,short_form,obo_id,logical_description,iri (different only by removing those ^ values) gives"Situs inversus totalis"
as the first result, which is not desirable.