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

Clarify capabilities of compound indexes with a text index

      Inspired by https://groups.google.com/forum/#!topic/mongodb-user/zSRygrd5GP0, I'd like to add more detail to http://docs.mongodb.org/manual/core/index-text/#compound-index to include a warning that a text index with following index keys, like

      { "t" : "text", "a" : 1 }

      does not provide the ability to sort on the following field using the compound index. For example, the following query uses the text index but is scanAndOrder = true

      db.test.find({ "$text" : { "$search" : "cookies" } }).sort({ "a" : 1 })

      The only indexed sort available is on strength of text match. I've seen a couple of questions where people express surprise at this limitation so I think it'd be nice to document it.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            william.berkeley William Berkeley
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 16 weeks, 5 days ago