Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62579

Community Edition 5.0.5 "text index required for $text query" with index present

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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
      1. Install Community Edition on MacOS
      2. Create text index on collection
      3. 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.

            Assignee:
            backlog-compass [DO NOT USE] Backlog - Compass Team
            Reporter:
            dylan.knight@securedcommunications.com Dylan Knight
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: