[DOCS-8701] Comment on: "manual/reference/operator/query/text.txt" Created: 30/Aug/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB 3.2.9, Windows 7 64 bit.

Location: https://docs.mongodb.com/manual/reference/operator/query/text/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
Screen Resolution: 1680 x 1050


Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

Could someone confirm the following strange behavior with MongoDB 3.2.9:
I have used the sample with db.articles collection at this location:
https://docs.mongodb.com/manual/reference/operator/query/text/

If you don't want to find the exact sample on MongoDB site, you could simply do the following:

db.articles.createIndex(

{ subject: "text" }

)
db.articles.insert(

{ _id: 1, subject: "coffee", author: "xyz", views: 50 }

)
db.articles.insert(

{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 }

)
db.articles.insert(

{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 }

)
db.articles.insert(

{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 }

)

When I type:
db.articles.find( { $text:

{ $search: "coffee" }

} )

it correctly finds 3 records.

Now add a new document with:
db.articles.insert({_id: 9, subject: "something", author: "whatever", views: 100})

and try to find it with:
db.articles.find( { $text:

{ $search: "something" }

} )

  • the document is found.

Now add a new document with:
db.articles.insert({_id: 10, subject: "more", author: "whatever", views: 100})

Now try to find that document with:
db.articles.find( { $text:

{ $search: "more" }

} )

Unfortunately, the document is not found. I'm afraid that this could be a sign for bigger problems in MongoDB text searching.

gogox@yahoo.com



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:56:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.