Glenn Karl Guiyab
Glenn Karl Guiyab

Reputation: 55

MongoDB $text search

query = { 
            "is_deleted"        : False, 
            "status_value"      : "PROSES"
        }

if keyword != "":
        query["$text"] = { "$search" : keyword }

db.db_konten.find(query)

I have a pymongo query using the text search of MongoDB. It works fine. But I found out that it cant searh the word very ? Is there a reason why. Im using python3 and Flask

Upvotes: 0

Views: 72

Answers (1)

Belly Buster
Belly Buster

Reputation: 8814

When your text index is set to English, it will exclude certain stop words, including very.

If you're interested, the full list is in the MongoDB source code.

You can also override it by setting the $language parameter when creating the text index.

Upvotes: 1

Related Questions