Adding filter to query in staging ES REST API expands the results
In production, adding filter
to query
results in removing some items from the results and the result list shrinks:
https://api.crossref.org/works?query=photomicrography : 446 items
https://api.crossref.org/works?query=photomicrography&filter=type:journal-article : 396 items
In staging it is the opposite:
https://api.staging.crossref.org/works?query=photomicrography : 23 items
https://api.staging.crossref.org/works?query=photomicrography&filter=type:journal-article : 5609607 items
In fact, this last request returns exactly the same number as https://api.staging.crossref.org/works?filter=type:journal-article
I suspect the reason is the default value of minimum_should_match ES parameter, which is 0 when both should
and filter
clauses in bool
query are specified. Setting this value to 1 could fix this.
Definition of done
-
Available via a staging URL -
Code reviewed -
Unit tests identified, implemented, and passing -
Public documentation reviewed and updated -
Knowledge base reviewed and updated -
Acceptance criteria met -
Adding filter
toquery
requests shrinks the results list appropriately -
query
andfilter
functionality continues to work as specified in the docs
-