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

[FTS][N1FTY] N1ql-search query fetching non-meta()id field not returning all the results

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Yes

    Description

      Build: 7.1.0 build 1047

      Job: centos-fts_custom-map-n1ql-rqg-scorch-match-phrase_6.5_P1
      Test: ./testrunner -i /tmp/testexec.6999.ini -p get-cbcollect-info=True,disable_HTP=True,get-logs=True,stop-on-failure=False,cluster=D+F,index_type=scorch,fts_quota=1000,run_via_n1ql=True,custom_map_add_non_indexed_fields=False,GROUP=N1QL_MATCH_PHRASE,query_types=N1QL_MATCH_PHRASE,get-cbcollect-info=False,bucket_storage=magma,enable_dp=True -t fts.stable_topology_fts.StableTopFTS.index_query_custom_mapping,items=1000,custom_map=True,cm_id=0,num_queries=100,compare_es=True,GROUP=BUCKETS;PS;N1QL_MATCH_PHRASE;COLLECTIONS

      Steps:

      • Load attached dataset
      • Create below custom index:

        {
          "type": "fulltext-index",
          "name": "custom_index",
          "uuid": "3f324f4944754fa8",
          "sourceType": "gocbcore",
          "sourceName": "default",
          "sourceUUID": "11fedff762ea8a0d40cfeef95ecc6d62",
          "planParams": {
            "maxPartitionsPerPIndex": 1024,
            "indexPartitions": 1
          },
          "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": {
                    "is_manager": {
                      "dynamic": false,
                      "enabled": true,
                      "fields": [
                        {
                          "include_in_all": true,
                          "include_term_vectors": true,
                          "index": true,
                          "name": "is_manager",
                          "type": "boolean"
                        }
                      ]
                    },
                    "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": {
                        "reports": {
                          "dynamic": false,
                          "enabled": true,
                          "fields": [
                            {
                              "analyzer": "standard",
                              "include_in_all": true,
                              "include_term_vectors": true,
                              "index": true,
                              "name": "reports",
                              "type": "text"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "store": {
              "indexType": "scorch",
              "mossStoreOptions": {},
              "segmentVersion": 15
            }
          },
          "sourceParams": {}
        }
        

      • Below FTS query returns 133 results:

        {"indexName": "custom_index", "size": 10000000, "from": 0, "explain": false, "query": {"field": "manages.reports", "match": "Solita Severin Lilith"}, "fields": [], "ctl": {"consistency": {"level": "", "vectors": {}}, "timeout": 60000}}
        

      • Below N1QL search query with meta().id returns 133 results:

        select meta().id from default where type='emp' and search(default, {"field": "manages.reports", "match": "Solita Severin Lilith"})
        

      • Below N1QL search queries with non-meta().id returns 20 results:

        select meta().id,* from default where type='emp' and search(default, {"field": "manages.reports", "match": "Solita Severin Lilith"},{"index": "custom_index"})
        select meta().id,* from default where type='emp' and search(default, {"field": "manages.reports", "match": "Solita Severin Lilith"})
        select manages.reports from default where type='emp' and search(default, {"field": "manages.reports", "match": "Solita Severin Lilith"})
        

      • Below are the docs not returned by n1ql-search query with non-meta().id:

        ['emp10000904', 'emp10000166', 'emp10000258', 'emp10000618', 'emp10000025', 'emp10000424', 'emp10000371', 'emp10000012', 'emp10000892', 'emp10000261', 'emp10000725', 'emp10000404', 'emp10000135', 'emp10000257', 'emp10000194', 'emp10000137', 'emp10000386', 'emp10000603', 'emp10000252', 'emp10000786', 'emp10000419', 'emp10000523', 'emp10000500', 'emp10000383', 'emp10000510', 'emp10000106', 'emp10000870', 'emp10000098', 'emp10000352', 'emp10000077', 'emp10000631', 'emp10000389', 'emp10000433', 'emp10000455', 'emp10000245', 'emp10000580', 'emp10000087', 'emp10000750', 'emp10000797', 'emp10000514', 'emp10000311', 'emp10000659', 'emp10000737', 'emp10000509', 'emp10000091', 'emp10000723', 'emp10000968', 'emp10000279', 'emp10000885', 'emp10000183']
         
        contents of emp10000904
         
        {
          "emp_id": "10000904",
          "name": "Solita Green",
          "dept": "HR",
          "email": "solita@mcdiabetes.com",
          "salary": 72309.68,
          "join_date": "1975-05-16T19:02:00",
          "languages_known": [
            "Thai",
            "Spanish",
            "Africans"
          ],
          "is_manager": true,
          "mutated": 0,
          "type": "emp",
          "manages": {
            "team_size": 8,
            "reports": [
              "Mercedes Thompson",
              "Bryn Sr.",
              "Fuscienne Miller XII",
              "Alarice Ann",
              "Darcei Taylor",
              "Solita Julián",
              "Kallie Gerónimo",
              "Kagami Thomas"
            ]
          }
        }
        

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty