1

Scenario

Searching for word such not working in MongoDB.

Steps to reproduce

In mongo shell:

use test
db.createCollection("data")
db.data.insert({"value": "word1 such word3 word4"})
db.data.createIndex({value: "text"})
db.data.find({$text: {$search: "word3"}}) -> returns the inserted document
db.data.find({$text: {$search: "such"}}) -> returns nothing

Desired behaviour

When searching for word such the inserted document should be returned.

  • "such" is a default stopword and not included in the full text index. Why was this closed, the question is perfectly clear? – Joni Dec 06 '18 at 14:22
  • Thanks. Indeed, I found the list of [stop-words](https://github.com/mongodb/mongo/blob/master/src/mongo/db/fts/stop_words_english.txt) for english. – Daniel BUDAȘCĂ Dec 06 '18 at 16:27

0 Answers0