Open marius-mather opened 11 months ago
I am looking into reimplementing annotations_trimmed to enhance the search boosting, but interested in your use case for returning them to the API consumer? Aren't the annotations values pretty much useless without the properties they correspond to?
This is an undocumented feature in OLS3 and was not intended to be used in this way. Having said that, this could be an interesting use case and is worth exploring further.
Yes, I've never found having annotations_trimmed
in the returned fields that useful, because you can't see what fields they correspond to. But the undocumented feature in OLS3 where you could request specific annotations turned out to be very useful, as 1 or 2 extra fields in the search result items can mean the difference between just using the search results, and having to do individual lookups of every term.
Possibly I only discovered this by reading the OLS3 source code, after trying to work out which annotations could actually be retrieved in the search endpoint. So I've made life hard for myself by relying on an undocumented feature. I've attempted a pull request for retrieving the specific annotations in #561
In the OLS3 search API it was possible to request individual annotation fields be included in the results via
fieldList
. You could either includeannotations_trimmed
, or specify an annotation by including<field_name>_annotation
infieldList
.Example OLS3 request:
This would return result items like:
Currently, neither form of the annotation seems to be supported in OLS4.
Including these annotations in search results is very useful for my use case because it means I can search for multiple results, without having to do individual requests on each term when I need to filter on one of these annotation properties.