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

[FlexIndex]Flex query with LIKE and querying for '%@%' will not consider fts index

    XMLWordPrintable

Details

    Description

      Build 7.0.0 build 1767

      Flex Query will not consider FTS index for the query with all wildcards like "%@%"

      Steps:
      Create a cluster with kv, query, fts
      Create a bucket and default fts index with email filed with keyword analyzer

      Index defn:

      {
        "type": "fulltext-index",
        "name": "default_index_1",
        "uuid": "2446010add734d27",
        "sourceType": "gocbcore",
        "sourceName": "default",
        "sourceUUID": "04fce8651da7c91e9e34ff56d6477820",
        "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": {
              "default_analyzer": "keyword",
              "dynamic": false,
              "enabled": true,
              "properties": {
                "email": {
                  "dynamic": false,
                  "enabled": true,
                  "fields": [
                    {
                      "analyzer": "keyword",
                      "index": true,
                      "name": "email",
                      "type": "text"
                    }
                  ]
                }
              }
            },
            "default_type": "_default",
            "docvalues_dynamic": true,
            "index_dynamic": true,
            "store_dynamic": false,
            "type_field": "_type"
          },
          "store": {
            "indexType": "scorch",
            "mossStoreOptions": {}
          }
        },
        "sourceParams": {}
      }
      

      Query : select email from default USE INDEX (USING FTS) where email LIKE 'email@%' ---> Good. Goes through FTS Index
      Query: select email from default USE INDEX (USING FTS) where email LIKE '%@%' ---> Fails. Does not consider FTS index.

      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
              girish.benakappa Girish Benakappa
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty