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

Different parsing for RLP index keys and queries leads to missing results

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.5
    • Affects Version/s: 3.1.2
    • Component/s: Text Search
    • Fully Compatible
    • ALL
    • Hide
      (function () {
          'use strict';
      
          var t = db.fts;
          t.drop();
      
          t.ensureIndex({a: 'text'});
          t.insert({a: 'hello.world', language: 'arabic'});
      
          assert.eq(t.find({$text: {$search: 'hello.world', $language: 'arabic'}}).itcount(), 1);
      }());
      
      Show
      (function () { 'use strict'; var t = db.fts; t.drop(); t.ensureIndex({a: 'text'}); t.insert({a: 'hello.world', language: 'arabic'}); assert.eq(t.find({$text: {$search: 'hello.world', $language: 'arabic'}}).itcount(), 1); }());
    • Platform 4 06/05/15, Platform 5 06/26/16

      When using RLP, there seems to be different parsing for index keys and queries, which can lead to missing results:

      > db.fts.ensureIndex({a: 'text'});
      // The index is created
      
      > db.fts.insert({a: 'hello.world', language: 'arabic'});
      // Resultant index key from the RLP tokenizer: "{ : \"hello.world\", : 1.1 }"
      
      > db.fts.find({$text: {$search: 'hello.world', $language: 'arabic'}}).itcount();
      0
      
      > db.fts.find({$text: {$search: 'hello.world', $language: 'arabic'}}).explain(true);
      
      // Parsed terms:
      "parsedTextQuery" : {
          "terms" : [
              "hello",
              "world"
          ],
          "negatedTerms" : [ ],
          "phrases" : [ ],
          "negatedPhrases" : [ ]
      }
      

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: