[SERVER-24972] Text search ignores some words Created: 10/Jul/16  Updated: 14/Jul/16  Resolved: 10/Jul/16

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

Type: Bug Priority: Major - P3
Reporter: Konstantin Khabarlak [X] Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

> db.s.insert({"name": "is"})
WriteResult({ "nInserted" : 1 })
> db.s.insert({"name": "dog"})
WriteResult({ "nInserted" : 1 })
> db.s.createIndex({"name": "text"})
{
        "createdCollectionAutomatically" : false,
        "numIndexesBefore" : 1,
        "numIndexesAfter" : 2,
        "ok" : 1
}
> db.s.find({$text: {$search: "is"}}) *why there are no results?*
> db.s.find({$text: {$search: "dog"}})
{ "_id" : ObjectId("578287a4a2bdbd1636963ee3"), "name" : "dog" }
> db.s.insert({"name": "this"})
WriteResult({ "nInserted" : 1 })
> db.s.insert({"name": "cat"})
WriteResult({ "nInserted" : 1 })
> db.s.find({$text: {$search: "cat"}})
{ "_id" : ObjectId("578287dba2bdbd1636963ee5"), "name" : "cat" }
> db.s.find({$text: {$search: "this"}})

Participants:

 Description   

Words like 'this', 'is' are ignored in text search. See Steps to Reproduce for more details



 Comments   
Comment by Konstantin Khabarlak [X] [ 11/Jul/16 ]

Didn't know that. Thanks a lot!

Comment by Ramon Fernandez Marina [ 10/Jul/16 ]

Capricornus, please see the documentation on text indexes:

text indexes drop language-specific stop words (e.g. in English, the, an, a, and, etc.) and use simple language-specific suffix stemming.

Words like "is" and "this" are stop words, and therefore not included in the index.

Regards,
Ramón.

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