-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 5.0.5
-
Component/s: Text Search
-
Environment:2019 Macbook Pro (Intel i9), Mac OS Monterey 12.1. Mongo compiled from tarball via Macports (macports.org).
-
ALL
-
- Install Community Edition on MacOS
- Create text index on collection
- Run a text search query
It seems as though my text index isn't being found when a $text query is issued to a single node cluster running locally on my macbook, currently version 5.0.5. I have another deployment of our system running against Atlas and don't experience any problems querying against that db's text index on the same collection. The indices in question on both deployments were originally created with the MongoDB Compass UI.
I ran the commands below in MongoSH in MongoDB Compass but got a similar result from the Node.js driver through mongoose.
> db.accountmembers.getIndices() [ { v: 2, key: { _id: 1 }, name: '_id_' }, { v: 2, key: { _fts: 'text', _ftsx: 1 }, name: 'textSearch', background: false, weights: { email: 1, firstname: 1, lastname: 1 }, default_language: 'english', language_override: 'language', textIndexVersion: 3 } ] > db.accountmembers.find({$text: {$search: "gmail", $language: "english"}}) MongoServerError: text index required for $text query
I tried deleting and recreating the index as well. It did't help.
I googled around for possible reasons this might be happening, but found nothing relevant.