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

Query planner should allow assignment of range predicates to compound text index prefix keys

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying, Text Search
    • Query Integration

    Description

      On a schema like the following:

      { _id : ObjectID, productId: String, description: String}

      With an index like:

      { fields: { 'productId': 1,  'description': 'text' } }

      Doing this query succeeds as expected:

      db.products.find({productId: 'P1234', $text: {$search : 'box'} } );

      But this query fails:

      db.products.find({productId: {$in: ['S00001', 'S00004'] }, $text: {$search : 'box'} } );
       "$err" : "Unable to execute query: error processing query: ns=unit_test.products limit=0 skip=0\nTree: $and\n    productId $in [ \"S00001\" \"S00004\" ]\n    TEXT : query=multiple, language=, tag=NULL\nSort: {}\nProj: {}\n planner returned error: failed to use text index to satisfy $text query (if text index is compound, are equality predicates given for all prefix fields?)",
              "code" : 17007

      Attachments

        Activity

          People

            backlog-query-integration Backlog - Query Integration
            wshaver Will Shaver
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: