Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-47538

n1fty: SEARCH(t,{ "match_all": {} }) on typed index returns wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 6.6.3, 7.0.1, 7.1.0
    • fts
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      {
       "name": "fix1",
       "type": "fulltext-index",
       "params": {
        "doc_config": {
         "docid_prefix_delim": "",
         "docid_regexp": "",
         "mode": "type_field",
         "type_field": "type"
        },
        "mapping": {
         "default_analyzer": "keyword",
         "default_datetime_parser": "dateTimeOptional",
         "default_field": "_all",
         "default_mapping": {
          "dynamic": true,
          "enabled": false
         },
         "default_type": "_default",
         "docvalues_dynamic": false,
         "index_dynamic": true,
         "store_dynamic": false,
         "type_field": "_type",
         "types": {
          "hotel": {
           "dynamic": true,
           "enabled": true,
           "properties": {
            "company": {
             "enabled": true,
             "dynamic": false,
             "fields": [
              {
               "index": true,
               "name": "company",
               "type": "text"
              }
             ]
            }
           }
          }
         }
        },
        "store": {
         "indexType": "scorch",
         "segmentVersion": 15
        }
       },
       "sourceType": "gocbcore",
       "sourceName": "default",
       "sourceUUID": "",
       "sourceParams": {},
       "planParams": {
        "maxPartitionsPerPIndex": 64,
        "indexPartitions": 1,
        "numReplicas": 0
       },
       "uuid": ""
      }
      

      INSERT INTO default VALUES("f01",{"type":"hotel", "company":"999"});
      INSERT INTO default VALUES("f02",{"type":"airport", "company":"999"});
      SELECT META(t).id 
      FROM `default` AS t USE INDEX (USING FTS) 
      WHERE t.type="hotel"  AND SEARCH(t,{ "match_all": {} });
      

      The index is type index on "hotel". Fts returns sargable with exact and query decided to use covering index. But Fts index giving documents from non matched types too.
      n1fty should not give the documents from other types or return exact false.
      If use * or reference any field n1ql turn off covering and returns right results.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-47538
          # Subject Branch Project Status CR V

          Activity

            People

              abhinav Abhi Dangeti
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty