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

[FTS - Scorch toybuild] Bool query does not honor the must_not clause correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.5.0
    • 5.5.0
    • fts
    • Untriaged
    • Centos 64-bit
    • Unknown

    Description

      Build
      5.1.0-1004 (first scorch toybuild)

      Testcase
      ./testrunner -i cent7.ini get-cbcollect-info=True,get-logs=False,stop-on-failure=False,cluster=D+F -t fts.stable_topology_fts.StableTopFTS.index_query_custom_mapping,items=1000,custom_map=True,cm_id=111,num_queries=100,compare_es=True,GROUP=P0,skip-cleanup=True

      2017-12-15 15:50:55 | INFO | MainProcess | Cluster_Thread | [task.execute] ----------------------------------------------------- Query # 6 ----------------------------------------------------
      2017-12-15 15:50:55 | INFO | MainProcess | Cluster_Thread | [fts_base.run_fts_query] Running query {"indexName": "custom_index", "from": 0, "fields": [], "explain": false, "ctl": {"timeout": 60000, "consistency": {"vectors": {}, "level": ""}}, "query": {"should": {"disjuncts": [{"field": "email", "match": "cassandra@mcdiabetes.com"}]}, "must_not": {"disjuncts": [{"field": "manages.reports", "match": "Tempest Jerica Dominique Kory"}]}, "must": {"conjuncts": [{"field": "manages.reports", "match": "Callia Callia"}, {"field": "manages.reports", "match": "Gabi Ambika Mercedes"}]}}, "size": 10000000} on node: 172.23.105.190:8094
      2017-12-15 15:50:55 | INFO | MainProcess | Cluster_Thread | [task.execute] Status: {u'successful': 6, u'failed': 0, u'total': 6, u'errors': {}}
      2017-12-15 15:50:55 | INFO | MainProcess | Cluster_Thread | [task.execute] FTS hits for query: {"should": {"disjuncts": [{"field": "email", "match": "cassandra@mcdiabetes.com"}]}, "must_not": {"disjuncts": [{"field": "manages.reports", "match": "Tempest Jerica Dominique Kory"}]}, "must": {"conjuncts": [{"field": "manages.reports", "match": "Callia Callia"}, {"field": "manages.reports", "match": "Gabi Ambika Mercedes"}]}} is 10 (took 13.345549ms)
      2017-12-15 15:50:55 | INFO | MainProcess | Cluster_Thread | [task.execute] ES hits for query: {"query": {"bool": {"should": {"match": {"email": "cassandra@mcdiabetes.com"}}, "must_not": {"match": {"manages.reports": "Tempest Jerica Dominique Kory"}}, "must": [{"match": {"manages.reports": "Callia Callia"}}, {"match": {"manages.reports": "Gabi Ambika Mercedes"}}]}}} on es_index is 9 (took 2ms)
      2017-12-15 15:50:55 | ERROR | MainProcess | Cluster_Thread | [task.execute] FAIL: FTS hits: 10, while ES hits: 9
      2017-12-15 15:50:55 | ERROR | MainProcess | Cluster_Thread | [task.execute] FAIL: Following 1 doc(s) were not returned by ES,but FTS, printing 50: [u'emp10000193']
      
      

      emp10000193 -

      {
        "salary": 134108.16,
        "name": "Trista Turner",
        "dept": "Training",
        "is_manager": true,
        "mutated": 0,
        "join_date": "2016-04-20T10:52:00",
        "manages": {
          "team_size": 10,
          "reports": [
            "Kala Jr.",
            "Tempest Davis",
            "Callia Julián",
            "Deandra Rogers",
            "Fantine Carter",
            "Dominique Edwards Sr.",
            "Cynara Nicolás",
            "Fuscienne Palmer",
            "Gallia King Jr.",
            "Mercedes Lewis"
          ]
        },
        "languages_known": [
          "Japanese",
          "Vietnamese",
          "Portuguese"
        ],
        "emp_id": "10000193",
        "type": "emp",
        "email": "trista@mcdiabetes.com"
      }
      

      You can see that the must_not clause is not being honored as fts returns the above doc containing "Tempest" and "Domnique" under manages.reports.

      Example:2

      {
        "must_not": {
          "disjuncts": [
            {
              "field": "manages.reports",
              "match": "Trista"
            },
            {
              "field": "manages.reports",
              "match": "Lucretia Alvita"
            }
          ]
        },
        "should": {
          "disjuncts": [
            {
              "field": "email",
              "match": "antonia@mcdiabetes.com"
            },
            {
              "field": "email",
              "match": "cassandra@mcdiabetes.com"
            }
          ]
        }
      }
      

      returns emp10000529:

       
      {
        "salary": 101917.28,
        "name": "Antonia Nicolás",
        "dept": "Marketing",
        "is_manager": true,
        "mutated": 0,
        "join_date": "1969-05-18T13:31:00",
        "manages": {
          "team_size": 9,
          "reports": [
            "Kerry Brown",
            "Kallie Thomas",
            "Keelia Jackson",
            "Deirdre Jones",
            "Killian Howard Jr.",
            "Tempest Hall",
            "Trista Lewis",
            "Ciara Wright",
            "Winta Ángel"
          ]
        },
        "languages_known": [
          "Quechua",
          "Japanese",
          "Spanish"
        ],
        "emp_id": "10000529",
        "type": "emp",
        "email": "antonia@mcdiabetes.com"
      }
      

      The above doc contains "Trista" under manages.reports.

      Attachments

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

        Activity

          People

            apiravi Aruna Piravi (Inactive)
            apiravi Aruna Piravi (Inactive)
            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