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

Query planner should be able to plan $text queries that require collection scan

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 2.6.0
    • Fix Version/s: Backlog
    • Component/s: Querying, Text Search
    • Labels:
      None

      Description

      On a schema like the following:

      { _id : ObjectID, description: String}

      With an index like:

      { fields: { 'description': 'text' } }

      Doing this with $and query succeeds as expected:

      db.products.find({$and:[{$text: {$search : 'box'} }, {search:'Box'}] );

      But this query fails:

      db.products.find({$or:[{$text: {$search : 'Bob'} }, {search:'Bob'}] );

      With this error

      $err" : "Runner error: BadValue error processing query: ns=unit_test.products limit=0 skip=0
      Tree: $or
      description== \"Bob\"
      TEXT : query=Bob, language=, tag=NULL
      Sort: {}
      Proj: {}
      planner returned error: Failed to produce a solution for TEXT under OR - other non-TEXT clauses under OR have to be indexed as well.",
      "code" : 17144

      (I realize this seems asinine, but my actual code is quite a bit more complicated with a full-text index on several different text fields.)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: