Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16153

Text search documentation should explicitly say that it's not supported through the Stable API

    XMLWordPrintableJSON

Details

    • 2

    Description

      In strict API mode $text queries are failing becaue Text indexes weren't included into the scope of the Stable API:

      $ mongosh "mongodb+srv://cluster1.fu4ty.mongodb.net" --apiVersion 1 --username admin --apiStrict
      Enter password: ***
      Current Mongosh Log ID: 646828b773b69b1d0be1e5fd
      Connecting to:          mongodb+srv://<credentials>@cluster1.fu4ty.mongodb.net/?appName=mongosh+1.6.0
      Using MongoDB:          (API Version 1)
      Using Mongosh:          1.6.0
       
      For mongosh info see: https://docs.mongodb.com/mongodb-shell/
       
      Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
        You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.
      Atlas atlas-11qc0x-shard-0 [primary] test> use test
      already on db test
      Atlas atlas-11qc0x-shard-0 [primary] test> db.reviews.find( { $text: { $search: "coffee -shop" } } )
      Uncaught:
      MongoServerError: error processing query: ns=test.reviewsTree: TEXT : query=coffee -shop, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL
      Sort: {}
      Proj: {}
       planner returned error :: caused by :: need exactly one text index for $text query
      

      The documentation should explicitly state this limitation.

      (Currently this can only be inferred from the line that says that text indexes can't be created)

      Attachments

        Activity

          People

            sarah.simpers@mongodb.com Sarah Simpers
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              37 weeks, 5 days ago