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

[FTS-Scorch] location field in query result-set points to a wrong field

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Build
      5.5.0-2156

      Testcase
      ./testrunner -i /tmp/testexec.4763.ini get-cbcollect-info=True,get-logs=False,stop-on-failure=False,index_type=scorch -t fts.stable_topology_fts.StableTopFTS.test_snippets_highlighting_of_search_term_in_results,items=10,expected_results=[

      {"doc_id":"emp10000001","field_name":"name","term":"Safiya"}

      ],cluster=D+F,D+F

      Please see the important difference for the same simple query below. While the query is

      "query": {"field": "name", "match": "Safiya"}
      

      "location" in result-set points to a different field 'manages.reports' in Scorch while it points to 'name' field in Upside down. I have a feeling fixing this might fix MB-28753 as well.

      Good news: reproducible

      Upside down

      [2018-03-15 01:44:30,678] - [fts_base:3424] INFO - Docs in bucket = 10, docs in FTS index 'default_index': 10
      [2018-03-15 01:44:30,701] - [fts_base:1991] INFO - Running query {"indexName": "default_index", "from": 0, "fields": [], "explain": false, "highlight": {}, "ctl": {"timeout": 60000, "consistency": {"vectors": {}, "level": ""}}, "query": {"field": "name", "match": "Safiya"}, "size": 10000000} on node: 172.23.104.105:
      [2018-03-15 01:44:30,775] - [stable_topology_fts:1546] INFO - Hits: 1
      [2018-03-15 01:44:30,775] - [stable_topology_fts:1547] INFO - Content: [{u'sort': [u'_score'], u'index': u'default_index_7fa82444f10c2936_13aa53f3', u'locations': {u'*name*': {u'safiya': [{u'start': 0, u'end': 6, u'pos': 1, u'array_positions': None}]}}, u'score': 0.7071067690849304, u'fragments': {u'name': [u'<mark>Safiya</mark> Palmer']}, u'id': u'emp10000001'}]
      

      Scorch

      [2018-03-16 06:09:31,631] - [fts_base:3424] INFO - Docs in bucket = 10, docs in FTS index 'default_index': 10
      [2018-03-16 06:09:31,669] - [fts_base:1991] INFO - Running query {"indexName": "default_index", "from": 0, "fields": [], "explain": false, "highlight": {}, "ctl": {"timeout": 60000, "consistency": {"vectors": {}, "level": ""}}, "query": {"field": "name", "match": "Safiya"}, "size": 10000000} on node: 172.23.104.108:
      [2018-03-16 06:09:31,846] - [stable_topology_fts:1546] INFO - Hits: 1
      [2018-03-16 06:09:31,846] - [stable_topology_fts:1547] INFO - Content: [{u'sort': [u'_score'], u'index': u'default_index_7da6601dea8d9957_13aa53f3', u'locations': {u'*manages.reports*': {u'safiya': [{u'start': 0, u'end': 6, u'pos': 1, u'array_positions': None}]}}, u'score': 0.7071067690849304, u'fragments': {u'manages.reports': [u'<mark>Safiya</mark> Palmer']}, u'id': u'emp10000001'}]
      

      The doc emp10000001 is -

      {
        "salary": 75891.68,
        "name": "Safiya Palmer",
        "mutated": 0,
        "is_manager": false,
        "dept": "Info-tech",
        "join_date": "1984-05-22T07:28:00",
        "languages_known": [
          "Quechua",
          "Portuguese",
          "Dutch"
        ],
        "emp_id": "10000001",
        "type": "emp",
        "email": "safiya@mcdiabetes.com"
      }
      

      As you can see there is no manages.reports field here. "Safiya" must be indexed under "name" instead.

      Attachments

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

        Activity

          People

            Sreekanth Sivasankaran Sreekanth Sivasankaran (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