[SERVER-20483] Search string that only contains negated words should have results Created: 18/Sep/15 Updated: 18/Sep/15 Resolved: 18/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Text Search |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Andrea Venchi | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
Now when I pass a search string that only contains negated words |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 18/Sep/15 ] |
|
Hi Andrea, It is expected that a search string containing only negated words will not return any results for a `$text` index: http://docs.mongodb.org/v3.0/reference/operator/query/text/#negations Similar to other text search implementations with boolean operators (eg. Lucene, MySQL, ...) negations are used to exclude documents from the result set that would otherwise be matched by terms in the text index. A query that only includes negative terms or stopwords will not return any results as there are no entries in the index to filter. Regards, |