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

[FTS] [N1FTY] Search query with array field not returning all the results

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Yes

    Description

      Build: 7.1.0 build 1047

      Job: centos-fts_n1ql-search-defmap-scorch_6.5_P0
      Test: ./testrunner -i /tmp/testexec.76274.ini -p cluster=D+F,get-cbcollect-info=False,disable_HTP=True,GROUP=P0;BUCKETS,index_type=scorch,fts_quota=1000,run_via_n1ql=True,get-cbcollect-info=False,bucket_storage=magma,enable_dp=True -t fts.stable_topology_fts.StableTopFTS.test_query_type,items=1000,num_queries=10,query_types=match,cluster=D,F,F,compare_es=True,GROUP=P0;BUCKETS;COLLECTIONS

      Steps:

      • Load the attached docs to a bucket
      • Create default FTS index

        {
          "type": "fulltext-index",
          "name": "default_index",
          "uuid": "99beb3d053e19c42",
          "sourceType": "gocbcore",
          "sourceName": "default",
          "sourceUUID": "0f9acdda7e8ec020291ff44d3ed4cd7a",
          "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": true
              },
              "default_type": "_default",
              "docvalues_dynamic": true,
              "index_dynamic": true,
              "store_dynamic": false,
              "type_field": "_type"
            },
            "store": {
              "indexType": "scorch",
              "mossStoreOptions": {},
              "segmentVersion": 15
            }
          },
          "sourceParams": {}
        }
        

      • For following FTS query, it returns 142 results. languages_known is an array field

        {"indexName": "default_index", "size": 10000000, "from": 0, "explain": false, "query": {"field": "languages_known", "match": "Quechua"}, "fields": [], "ctl": {"consistency": {"level": "", "vectors": {}}, "timeout": 60000}}
        

      • For following N1QL-Search query, it returns 51 results:

        select meta().id from default where type='emp' and search(default, {"field": "languages_known", "match": "Quechua"})
        

      Following are some of the docs which returned by FTS but not by n1ql-search query.

      ['emp10000007', 'emp10000654', 'emp10000656', 'emp10000145', 'emp10000274', 'emp10000419', 'emp10000307', 'emp10000699', 'emp10000903', 'emp10000154', 'emp10000190', 'emp10000720', 'emp10000630', 'emp10000113', 'emp10000272', 'emp10000862', 'emp10000568', 'emp10000058', 'emp10000227', 'emp10000455', 'emp10000268', 'emp10000403', 'emp10000203', 'emp10000460', 'emp10000192', 'emp10000351', 'emp10000423', 'emp10000207', 'emp10000530', 'emp10000789', 'emp10000086', 'emp10000387', 'emp10000844', 'emp10000664', 'emp10000934', 'emp10000586', 'emp10000480', 'emp10000293', 'emp10000503', 'emp10000218', 'emp10000108', 'emp10000913', 'emp10000398', 'emp10000936', 'emp10000377', 'emp10000140', 'emp10000703', 'emp10000955', 'emp10000557', 'emp10000709']
      

      Looking more into the results of both the query. it seems n1ql-search query only returning the docs which has search value (Quechua) as the last element in the array field (languages_known)

      Few results returned by n1ql-search query:

      id	languages_known
      "emp10000843"	["Thai","English","Quechua"]
      "emp10000821"	["Arabic","Spanish","Quechua"]
      "emp10000543"	["Malay","Africans","Quechua"]
      "emp10000029"	["German","Italian","Quechua"]
      "emp10000151"	["Urdu","German","Quechua"]
      "emp10000238"	["Italian","Romanian","Quechua"]
      "emp10000623"	["Africans","Thai","Quechua"]
      "emp10000666"	["Urdu","Hindi","Quechua"]
      "emp10000181"	["Spanish","French","Quechua"]
      "emp10000748"	["Spanish","Vietnamese","Quechua"]
      

      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