Mongo Db search by indexed field

前端 未结 2 539
别跟我提以往
别跟我提以往 2021-01-14 15:38

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

2条回答
  •  时光取名叫无心
    2021-01-14 16:39

    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.

提交回复
热议问题