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

Discrepancy between fts and n1ql hits for search query

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Critical
    • 7.2.1
    • 7.2.1
    • fts

    Description

       

      Build : 7.2.1-5919
      Subcomponent: custom-map-n1ql-rqg-scorch_6.5_P1 

      Steps in test:

      1. Run FTS query
      2. Run FTS query on ES Index
      3. Run FTS query using n1ql

       dataset = "all" -> which means half emp dataset and half wiki dataset

       

      Run 100 queries -> FTS N1QL and on ES. 

      We expect all 3 to return same no of hits. Observing n1ql to give less hits than FTS hits on one of the query ( #45 Query in this case), all other queries on the other hand ran successfully.

      FTS INDEX
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [fts_base.run_fts_query] Running query {"indexName": "custom_index", "size": 10000000, "from": 0, "explain": false, "query": {"query": "-name:\"Aar��n\""}, "fields": [], "ctl": {"consistency": {"level": "", "vectors": {}}, "timeout": 60000}} on node as 172.23.107.9 : Administrator:
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [rest_client.urllib_request] Making a rest request api=http://172.23.107.9:8094/api/index/custom_index/query verb=POST params=b'{"indexName": "custom_index", "size": 10000000, "from": 0, "explain": false, "query": {"query": "-name:\\"Aar\xc3\xb3n\\""}, "fields": [], "ctl": {"consistency": {"level": "", "vectors": {}}, "timeout": 60000}}' client_cert=None verify=False
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [task.execute] Status: {'total': 1, 'failed': 0, 'successful': 1}
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [task.execute] FTS hits for query: {"query": "-name:\"Aar��n\""} is 1000 (took 0.906743ms)
       
      ES INDEX 
       
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [es_base.search] ES query '{'query': {'query_string': {'query': '-name:"Aar��n"'}}}' 
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [task.execute] ES hits for query: {"query": {"query_string": {"query": "-name:\"Aar��n\""}}} on es_index is 1000 (took 64ms)
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | 
       
      [task.execute] SUCCESS: Docs returned by FTS = docs returned by ES, doc_ids verified
       
       
      N1QL
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [task.execute] Running N1QL query: select meta().id from default where type='emp' and search(default, {"query": "-name:\"Aar��n\""},{"index": "custom_index"})
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [rest_client.query_tool] query params : statement=select+meta%28%29.id+from+default+where+type%3D%27emp%27+and+search%28default%2C+%7B%22query%22%3A+%22-name%3A%5C%22Aar%C3%B3n%5C%22%22%7D%2C%7B%22index%22%3A+%22custom_index%22%7D%29
      2023-08-22 20:05:29 | INFO | MainProcess | Cluster_Thread | [task.execute] N1QL hits for query: "select meta().id from default where type='emp' and search(default, {\"query\": \"-name:\\\"Aar��n\\\"\"},{\"index\": \"custom_index\"})" is 500 (took 74.670426ms)
      2023-08-22 20:05:29 | ERROR | MainProcess | Cluster_Thread | 
       
      [task.execute] FAIL: FTS hits: 1000, while N1QL hits: 500
      2023-08-22 20:05:29 | ERROR | MainProcess | Cluster_Thread | 
       
      [task.execute] FAIL: Following 500 doc(s) were not returned by N1QL,but FTS, printing 50: ['wiki10000318', 'wiki10000028', 'wiki10000113', 'wiki10000250', 'wiki10000080', 'wiki10000382', 'wiki10000236', 'wiki10000164', 'wiki10000400', 'wiki10000006', 'wiki10000354', 'wiki10000182', 'wiki10000161', 'wiki10000079', 'wiki10000139', 'wiki10000373', 'wiki10000386', 'wiki10000044', 'wiki10000402', 'wiki10000163', 'wiki10000421', 'wiki10000048', 'wiki10000010', 'wiki10000326', 'wiki10000196', 'wiki10000365', 'wiki10000283', 'wiki10000188', 'wiki10000492', 'wiki10000454', 'wiki10000105', 'wiki10000211', 'wiki10000395', 'wiki10000174', 'wiki10000435', 'wiki10000476', 'wiki10000497', 'wiki10000252', 'wiki10000370', 'wiki10000444', 'wiki10000417', 'wiki10000197', 'wiki10000271', 'wiki10000144', 'wiki10000212', 'wiki10000455', 'wiki10000359', 'wiki10000334', 'wiki10000431', 'wiki10000206'] 

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            abhinav Abhi Dangeti
            sarthak.dua Sarthak Dua
            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