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

Flex Index: Default Index: queries with arrays returns 0 results from FTS index

    XMLWordPrintable

Details

    • 1

    Description

      Build:7.0.0 build 2016

      • 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 but GSI do returns 71 results

         
        Number of results from flex query: select meta().id from default USE INDEX (USING FTS, USING GSI) where  ANY v IN languages_known SATISFIES v = "Japanese" END is 0
         
        Number of results from gsi query: select meta().id from default USE INDEX (USING GSI) where  ANY v IN languages_known SATISFIES v = "Japanese" END is 71
         
        Explain plan:
         
        {
            "#operator": "Sequence",
            "~children": [
                {
                    "#operator": "IndexFtsSearch",
                    "covers": [
                        "cover (any `v` in (`default`.`languages_known`) satisfies (`v` = \"Japanese\") end)",
                        "cover ((meta(`default`).`id`))"
                    ],
                    "index": "default_index",
                    "index_id": "12b646a78c84ef13",
                    "keyspace": "default",
                    "namespace": "default",
                    "search_info": {
                        "field": "\"\"",
                        "options": "{\"index\": \"default_index\"}",
                        "outname": "out",
                        "query": "{\"query\": {\"field\": \"languages_known\", \"term\": \"Japanese\"}, \"score\": \"none\"}"
                    },
                    "using": "fts"
                },
                {
                    "#operator": "Parallel",
                    "~child": {
                        "#operator": "Sequence",
                        "~children": [
                            {
                                "#operator": "Filter",
                                "condition": "cover (any `v` in (`default`.`languages_known`) satisfies (`v` = \"Japanese\") end)"
                            },
                            {
                                "#operator": "InitialProject",
                                "result_terms": [
                                    {
                                        "expr": "cover ((meta(`default`).`id`))"
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        }
        

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty