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

Add restriction to Compound Index: text fields must be adjacent

    XMLWordPrintableJSON

Details

    • 0.1

    Description

      RE: https://docs.mongodb.com/manual/core/index-text/#compound-index

      Additional restriction should appear under "compound index":

      • When creating a compound index, all "text" fields must be adjacent.

      Example of the error one gets otherwise:

      >db.text.createIndex({a:"text",b:1,c:"text"})
      {
              "ok" : 0,
              "errmsg" : "'text' fields in index must all be adjacent",
              "code" : 67,
              "codeName" : "CannotCreateIndex"
      }
      

      Also, there is a self-link in this sentence:

      See also Text Index and Sort for additional limitations.

      Attachments

        Activity

          People

            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 14 weeks, 6 days ago