You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/11/30 08:04:33 UTC
[GitHub] tonysun83 opened a new pull request #1783: fix empty queries
tonysun83 opened a new pull request #1783: fix empty queries
URL: https://github.com/apache/couchdb/pull/1783
## Overview
Mango text indexes currently throw function clauses when queries in two
situations:
1) Empty Selector
2) Operators with empty arrays.
We fix this issue and change the behavior as follows:
1) Any empty selector will fall back on _all_docs (like json indexes).
2) $or, $and, $in, $all that specify an empty arrays
will be treated as no-op when combined with other operators.
3) A single no-nop query such as {"$or": []} will not be executed and
return nothing just like json indexes.
4) $nin with an empty array will return all docs that match the field,
just like json indexes.
## Testing recommendations
New tests were added to the python suite and can be run with
MANGO_TEXT_INDEXES=1 nosetests --nocapture test/06-basic-text-test.py
This requires a clouseau setup.
## Related Issues or Pull Requests
The issue is this PR.
## Checklist
- [X] Code is written and works correctly;
- [X] Changes are covered by tests;
- [ ] Documentation reflects the changes;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services