[SERVER-76174] $text OR condition on phrases not working Created: 17/Apr/23  Updated: 17/Apr/23  Resolved: 17/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Abdul Mateen Ahmad Khan Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-76176 $text OR condition on phrases not wor... Closed
Operating System: ALL
Participants:

 Description   

Hello ,

I think i have found a bug with $text command which is used to invoke the text indexes. The command fails when we are trying to search for multiple phrases and use an OR condition. for example:
find({'$text':{'$search':'\"\"works at company1\" \"Adam\" \"'}})

 This command tokenizes the first phrase and gets documents having 'works' keyword OR 'company1' keyword OR 'Adam' keyword. which is not what we want.  We want the command to get 'works at walee' phrase which is not what the command does.

the AND command:
find({'$text':{'$search':'\"works at company1\" \"Adam\" '}})

works fine and only gets documents which has both the phrase and the keyword doing exact phrase matching .


Generated at Thu Feb 08 06:32:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.