[SERVER-34521] Text Search not working properly Created: 17/Apr/18  Updated: 24/Apr/18  Resolved: 17/Apr/18

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

Type: Bug Priority: Major - P3
Reporter: Rahul Raj Assignee: Kelsey Schubert
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DOCS-11632 Text Search not working properly Closed
Operating System: ALL
Participants:

 Description   

When I hit the query:
db.sample.find({ $text:

{ $search: "cakes \"coffee shop\"" }

})

I get only one result:

/* 1 */
{
    "_id" : ObjectId("5ad609baac1a8b644180936b"),
    "content" : "coffee shop..."
}

Here is the data set:

/* 1 */
{
    "_id" : ObjectId("5ad609a2ac1a8b644180936a"),
    "content" : "Coffee and cakes..."
}
 
/* 2 */
{
    "_id" : ObjectId("5ad609baac1a8b644180936b"),
    "content" : "coffee shop..."
}

Text index was already created for content field.

As per the mongo docs here:
https://docs.mongodb.com/manual/text-search/

It says it returns all documents containing “coffee shop” OR “cakes”. So it should return both documents. It isnt happening here.


Generated at Thu Feb 08 04:36:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.