Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty value for compare limits changes results, silently without error #144

Open
organisciak opened this issue Jan 13, 2021 · 1 comment

Comments

@bmschmidt
Copy link
Member

Those appear to be two different queries? (publication_country__id is in the second).

Behavior is anticipated but maybe not explained anywhere.
When compare_limits is undefined, the API uses search_limits but with the word key removed, which is the most common use case. (E.g., count the total number of words in this corpus as the comparison for the number of words my search limit is defined.) When compare_limits is intentionally set to empty, OTOH, it returns the counts for the entire database without regard to the search_limits.

An empty compare_limits should be {}, not [], because you may only have one reference corpus.

If compare_limits is undefined and 'word' is not a key in the search_limits, I think it just starts removing things by some pattern I don't fully know.

There's also an undocumented shorthand where you can write {"search_limits": {"word": ["foo"], "*topic": ["bar"]}} where the asterisk directs the API to drop topic, rather than 'word', when it builds compare_limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants