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

FlexIndex:Default Index: Flex query returns 0 results when using LIKE over text with special characters

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Build: 6.6.0 build 7661

      • Load dataset attached
      • Create default fts index with keyword analyzer:

        {
          "type": "fulltext-index",
          "name": "default_index",
          "uuid": "5005f41409c983df",
          "sourceType": "gocbcore",
          "sourceName": "default",
          "sourceUUID": "b08aa384fdcd7adfdfe3569237428631",
          "planParams": {
            "maxPartitionsPerPIndex": 171
          },
          "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": true,
                "enabled": true
              },
              "default_type": "_default",
              "docvalues_dynamic": true,
              "index_dynamic": true,
              "store_dynamic": false,
              "type_field": "type"
            },
            "store": {
              "indexType": "scorch",
              "mossStoreOptions": {}
            }
          },
          "sourceParams": {}
        }
        

      • Create GSI primary index
      • For the below Flex queries, fts index is considered but returns 0 results where with GSi it returns 2 results

        select meta().id from default USE INDEX (USING FTS, USING GSI) where  ( revision.text.`#text` like "Fil%")
        

      • Explain Plan:

        {
            "#operator": "Sequence",
            "~children": [
                {
                    "#operator": "IndexFtsSearch",
                    "index": "default_index",
                    "index_id": "299d3d0253eb3ec4",
                    "keyspace": "default",
                    "namespace": "default",
                    "search_info": {
                        "field": "\"\"",
                        "options": "{\"index\": \"default_index\"}",
                        "outname": "out",
                        "query": "{\"query\": {\"field\": \"revision.text.#text\", \"inclusive_max\": false, \"inclusive_min\": true, \"max\": \"Fim\", \"min\": \"Fil\"}, \"score\": \"none\"}"
                    },
                    "using": "fts"
                },
                {
                    "#operator": "Fetch",
                    "keyspace": "default",
                    "namespace": "default"
                },
                {
                    "#operator": "Parallel",
                    "~child": {
                        "#operator": "Sequence",
                        "~children": [
                            {
                                "#operator": "Filter",
                                "condition": "((((`default`.`revision`).`text`).`#text`) like \"Fil%\")"
                            },
                            {
                                "#operator": "InitialProject",
                                "result_terms": [
                                    {
                                        "expr": "(meta(`default`).`id`)"
                                    }
                                ]
                            },
                            {
                                "#operator": "FinalProject"
                            }
                        ]
                    }
                }
            ]
        }
        

      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:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty