Closed jduss4 closed 7 years ago
Yes, please 😄 This is handy for script cURLs where we just want one field's value or a short list of fields.
I wonder if we could even handle the includes/excludes part by preceding a field name or wildcard pattern with !
. For their example, we'd write as:
?fields[]=obj1.*&fields[]=obj2.*&fields[]=!*.description
yeah, that seems quite possible, especially with the elasticsearch syntax to help out. @karindalziel do you know off the top of your head if that's possible with solr as a backend?
For the sake of shorter URLs, should this actually be comma-delineated or separated by | ?
?fields=title|author.name|date*|!date_d
Something like that? Rather than
?field[]=title&field[]=author.name&field[]=date*&field[]=!date_d
Changing it to fl
for field or field list to make it shorter, regardless.
Same name that solr uses for it (elasticsearch uses "source" )
In solr you may not exclude returning fields, but have to whitelist all you want if you list any. Do we want to offer blacklisting functionality knowing that if we switch the backend it would not be backwards compatible?
@karindalziel @techgique ?
Addressed this here: https://github.com/CDRH/api/commit/e522f329173810fa32e3e8f323a33cebabbdeb0a
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html
I think it would be useful to be able to get only a list of ids + titles, etc, back, the way that you can limit the returning fields in Solr. I imagine it would look something like this?
fields[]=id&fields[]=title