I add field \'search_string\' to my document and index it. db.my_collection.createIndex({search_string: \"text\"})
Search_string contains this: \'a ar are aren
By default, MongoDB uses English for text index and the stop words are not indexed.
If you specify a language value of "none", then the text search uses simple tokenization with no list of stop words and no stemming.
So you should create your index like this :
db.my_collection.createIndex(
{ search_string : "text" },
{ default_language: "none" }
)
MongoDB documentation here.
From the MongoDB manual
Match Operation
Stop Words
The $text operator ignores language-specific stop words, such as the and and in English.
Both "a" and "are" are in the list of default English language stopwords so will be ignored. A quick google search for English language stopwords will find plenty of pages with the full list.