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

FlexIndex: FTS index(with type mapping) returns 0 results for query:predicate with number in an object

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Build: 7.0.0-1834

      • Load dataset attached
      • Create fts index with below:

        {
          "type": "fulltext-index",
          "name": "custom_index",
          "uuid": "5c81ffc46524a27e",
          "sourceType": "gocbcore",
          "sourceName": "default",
          "sourceUUID": "d7b8b98dd42ed0030d203a0b2c2f7406",
          "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": {
                "dynamic": true,
                "enabled": false
              },
              "default_type": "_default",
              "docvalues_dynamic": true,
              "index_dynamic": true,
              "store_dynamic": false,
              "type_field": "type",
              "types": {
                "emp": {
                  "dynamic": false,
                  "enabled": true,
                  "properties": {
                    "join_date": {
                      "dynamic": false,
                      "enabled": true,
                      "fields": [
                        {
                          "include_in_all": true,
                          "include_term_vectors": true,
                          "index": true,
                          "name": "join_date",
                          "type": "datetime"
                        }
                      ]
                    },
                    "manages": {
                      "dynamic": false,
                      "enabled": true,
                      "properties": {
                        "team_size": {
                          "dynamic": false,
                          "enabled": true,
                          "fields": [
                            {
                              "include_in_all": true,
                              "include_term_vectors": true,
                              "index": true,
                              "name": "team_size",
                              "type": "number"
                            }
                          ]
                        }
                      }
                    },
                    "mutated": {
                      "dynamic": false,
                      "enabled": true,
                      "fields": [
                        {
                          "include_in_all": true,
                          "include_term_vectors": true,
                          "index": true,
                          "name": "mutated",
                          "type": "number"
                        }
                      ]
                    },
                    "name": {
                      "dynamic": false,
                      "enabled": true,
                      "fields": [
                        {
                          "analyzer": "keyword",
                          "include_in_all": true,
                          "include_term_vectors": true,
                          "index": true,
                          "name": "name",
                          "type": "text"
                        }
                      ]
                    }
                  }
                }
              }
            },
            "store": {
              "indexType": "scorch",
              "mossStoreOptions": {}
            }
          },
          "sourceParams": {}
        }
        

      • Create GSI primary index
      • For the below Flex query, fts index returns 0 results:

        select meta().id from default USE INDEX (custom_index USING FTS) where type = "emp" and manages.team_size > 2 and manages.team_size < 8
        

      • Same query with GSI returns 259 results

        select meta().id from default USE INDEX (custom_index USING GSI) where type = "emp" and manages.team_size > 2 and manages.team_size < 8
        

      • Similar FTS query also returns 259 results

        curl -XPOST -H "Content-Type: application/json" \
        -u <username>:<password> http://172.23.121.65:8094/api/index/custom_index/query \
        -d '{
          "explain": true,
          "fields": [
            "*"
          ],
          "highlight": {},
          "query": {
            "query": "manages.team_size:>2 +manages.team_size:<8"
          }
        }'
        

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-38895
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty