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

[N1QL+FTS] During verification set DefaultAnalyzer correctly in case "field" is not specified in FTS query

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Non-covering queries when the field name isn't specified - needs the query to look into the _all field (if available).

      As part of verification - in this situation we will need to set the analyzer for the default mapping correctly so non-analytic queries work correctly (keyword analyzer).

      Example index definition:

       {
        "type": "fulltext-index",
        "name": "default",
        "uuid": "558d7e033dff989e",
        "sourceType": "couchbase",
        "sourceName": "default",
        "sourceUUID": "37ad8b8f5d53e38f4fff0bbbc9175671",
        "planParams": {
          "maxPartitionsPerPIndex": 171,
          "indexPartitions": 6
        },
        "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": true,
            "index_dynamic": true,
            "store_dynamic": false,
            "type_field": "_type",
            "types": {
              "hotel": {
                "default_analyzer": "keyword",
                "dynamic": true,
                "enabled": true
              }
            }
          },
          "store": {
            "indexType": "scorch"
          }
        },
        "sourceParams": {}
      }

      Example query:

      SELECT * 
      FROM default AS d
      WHERE d.type='hotel'
      and search (d, {"query":{"wildcard":"*garden*"}})
      limit 1;

       

      The workaround without a fix is to use the field setting within the query.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty