[SERVER-28522] Is there a way to force at least one term from a list in a full text search in MongoDB? Created: 28/Mar/17 Updated: 28/Mar/17 Resolved: 28/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Text Search |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kindox | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Sorry if this is the wrong place to put this issue but I wrote in both: stackoverflow with mongodb tag and google groups but no one replied. This is really important for me, please help me. Maybe this is just a question, maybe a feature request depending of your answer: Is there a way to force at least one term from a list in a full text search in MongoDB? Let me show you a very simple example:
Then I created a text index:
Note that MongoDB firstly splits the string values by the comma internally in order to index words, I even checked that using db.palette.validate() information. Finally I tried to search with the following command using a query string similar to the some official example from documentation:
I need to retrieve only second and third document but the result includes the first one too (green,black). I am asking for a way to do exactly what MySQL does in this case if I use a query like this:
MySQL selects all the rows that contain "green" AND ("red" OR "blue") in some of the indexed columns. Note that if some row only contains green it won't be selected. Thanks in advanced |
| Comments |
| Comment by Kelsey Schubert [ 28/Mar/17 ] |
|
Hi kindox, This feature request is being tracked in SERVER-22583. Please feel free to vote for it and watch it for updates. Thank you, |