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

Query Planner splits search string in terms even if it's between quotes

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 4.2.15
    • None
    • None
    • ALL

    Description

      I am using $text $search between double quotes to search Star System names in my database(~4.5milion records). The problem is that the query planner splits my search string into two terms (TRAPPIST and 1) and performs a full scan of the collection (which has a lot of names with xxx-xxx-1 in it) and the query goes over the 20 second timeout set for the web service accessing the database.

      It should be an instant find of 1 document, but the query planner goes through all those "1" documents for nothing. 

      "$text" : { "$search" : "\"TRAPPIST-1\"" }

      Check my attached query planner, it has two IXSCANs and the terms are split into ["1","TRAPPIST"]

      For a scan of the text TRAPPIST (no "-1") there is only one term and one IXSCAN and the query finishes in ~200ms.

       

      Attachments

        Activity

          People

            edwin.zhou@mongodb.com Edwin Zhou
            rayden_and@yahoo.com rayden hayden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: