[SERVER-26962] Text search doesn't work properly if query contains word "OTHER" Created: 09/Nov/16  Updated: 09/Nov/16  Resolved: 09/Nov/16

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

Type: Bug Priority: Major - P3
Reporter: Jakub Rutkowski 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:

1. Create sample collection: test
2. Create sample text index:

db.getCollection('test').createIndex( { name: "text" } )

3. Feed collection with some documents:

{
    "_id" : ObjectId("58230e1a2061b3081d657f3f"),
    "name" : "1"
}
{
    "_id" : ObjectId("58230f972061b3081d657f40"),
    "name" : "TEST OTHER"
}
{
    "_id" : ObjectId("58230f9d2061b3081d657f41"),
    "name" : "TEST OTHERS"
}
{
    "_id" : ObjectId("582310352061b3081d657f42"),
    "name" : "OTHER"
}

4. Do search request with "OTHER" keyword

db.getCollection('test').find({ $text: { $search: "OTHER" } })

There are no documents returned. If word "OTHER" was changed to "OTHERS" - everything is ok - 1 document returned.

Participants:

 Comments   
Comment by Ramon Fernandez Marina [ 09/Nov/16 ]

The word "other" is a stop word, and it's neither indexed nor used in searches. Unfortunately there's currently no way to customize the list of stop words – see SERVER-10062 for more information.

Regards,
Ramón.

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