[SERVER-62579] Community Edition 5.0.5 "text index required for $text query" with index present Created: 12/Jan/22 Updated: 02/Feb/22 |
|
| Status: | Needs Scheduling |
| Project: | Core Server |
| Component/s: | Text Search |
| Affects Version/s: | 5.0.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dylan Knight | Assignee: | Backlog - Compass Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | text_index | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
2019 Macbook Pro (Intel i9), Mac OS Monterey 12.1. Mongo compiled from tarball via Macports (macports.org). |
||
| Operating System: | ALL |
| Steps To Reproduce: |
|
| Participants: |
| Description |
|
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.
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. |
| Comments |
| Comment by Dylan Knight [ 02/Feb/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I don't think this is a Compass issue | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dylan Knight [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
it's a single-member replica set | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dylan Knight [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I was able to get the same behavior in the Terminal with the old "mongo" command line tool. `createIndex` hung. I killed the process, logged back in, it listed the index, but I got the missing index error when I ran the query. The macports `mongo-tools` package doesn't seem to have 'mongosh' in it yet. @dmitry.agranat@mongodb.com | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Agranat [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I was running on a replica set. This might not be related to the Server-side so I am moving this to the Compass team to take a look. Just to confirm, is it a single-member replica set or a PSA deployment? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dylan Knight [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I ran the commads in the bottom shell view of Compass 1.29.4 Are you running a single node replica set, too? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Agranat [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I am unable to reproduce this on MongoDB 5.0.5 communitry or enterprise but I am also not having troubles with the shell just spinning and not returning to a prompt:
So the error you were getting is expected as in "the index you are trying to retrieve does not exist because it was not created". I am going to try to understand why you have the mentioned shell issues. What shell/mongoSH version do you use? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dylan Knight [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
@dmitry.agranat@mongodb.com
After killing the shell process, and reconnecting. I can run the remaining commands and I get the same output as I pasted above:
Does this sufficiently prove that I'm not wasting your time? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Agranat [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Thanks dylan.knight@securedcommunications.com, can you post here the exact method used to create text index via MongoSH together with the corresponding db.collection.getIndexes() command? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dylan Knight [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I'm pretty sure I created it with the Compass UI, @dmitry.agranat@mongodb.com
| ||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Agranat [ 25/Jan/22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hi dylan.knight@securedcommunications.com, could you please post here how that index was created, was it just text: true into the name field in the schema or with:
|