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

N1fty: N1ql search not honoring keyword text analyzer for neg cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 7.1.0
    • 7.1.0
    • fts
    • Untriaged
    • 1
    • Unknown

    Description

      Build: 7.1.0-1601

      • Create a bucket with one doc like below:

        {
          "click": "to edit",
          "with JSON": "there are no reserved field names",
          "type": "doc"
        }
        

      • Create a fts index like below:

        curl -XPUT -H "Content-Type: application/json" \
        -u <username>:<password> http://172.23.100.13:8094/api/index/first -d \
        '{
          "type": "fulltext-index",
          "name": "first",
          "uuid": "4bd9ec59f10a7fe3",
          "sourceType": "gocbcore",
          "sourceName": "def",
          "sourceUUID": "b8f67dd024b2b26f0824fdd585ec812c",
          "planParams": {
            "maxPartitionsPerPIndex": 1024,
            "indexPartitions": 1
          },
          "params": {
            "doc_config": {
              "docid_prefix_delim": "",
              "docid_regexp": "",
              "mode": "type_field",
              "type_field": "type"
            },
            "mapping": {
              "analysis": {},
              "default_analyzer": "standard",
              "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": {
                "doc": {
                  "dynamic": false,
                  "enabled": true,
                  "properties": {
                    "click": {
                      "dynamic": false,
                      "enabled": true,
                      "fields": [
                        {
                          "analyzer": "keyword",
                          "include_in_all": true,
                          "include_term_vectors": true,
                          "index": true,
                          "name": "click",
                          "type": "text"
                        }
                      ]
                    }
                  }
                }
              }
            },
            "store": {
              "indexType": "scorch",
              "segmentVersion": 15
            }
          },
          "sourceParams": {}
        }'
        

      Run Below queries:

      select meta().id from def where type='doc' and search(def, {"query": "click:\"to edit\""})
      Returns 1 doc as expected
      

      select meta().id from def where type='doc' and search(def, {"query": "-click:\"to edit\""})
      Returns 0 docs as expected
      

      select meta().id from def where type='doc' and search(def, {"query": "click:\"to\""})
      Returns 0 docs as expected
      

      select meta().id from def where type='doc' and search(def, {"query": "-click:\"to\""})
      *Returns 0 docs but we expect 1 doc
      *
      Querying fts directly returns 1 doc:
      curl -XPOST -H "Content-Type: application/json" \
      -u <username>:<password> http://172.23.100.13:8094/api/index/first/query \
      -d '{
        "explain": true,
        "fields": [
          "*"
        ],
        "highlight": {},
        "query": {
          "query": "-click:\"to\""
        },
        "size": 10,
        "from": 0
      }'
       
      
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              abhinav Abhi Dangeti
              girish.benakappa Girish Benakappa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty