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

FTS: geospatial query results order differs for CB and Elastic.

    XMLWordPrintable

Details

    • Untriaged
    • Centos 64-bit
    • 1
    • Unknown

    Description

      Build: 7.0.0-4797

      Create bucket `default`, load attached data (default.json)

      Create the following FTS index:

      {
       "name": "geo-index",
       "type": "fulltext-index",
       "params": {
        "doc_config": {
         "docid_prefix_delim": "",
         "docid_regexp": "",
         "mode": "type_field",
         "type_field": "type"
        },
        "mapping": {
         "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": {
          "earthquake": {
           "dynamic": true,
           "enabled": true,
           "properties": {
            "geo": {
             "enabled": true,
             "dynamic": false,
             "fields": [
              {
               "docvalues": true,
               "include_in_all": true,
               "index": true,
               "name": "geo",
               "type": "geopoint"
              }
             ]
            }
           }
          }
         }
        },
        "store": {
         "indexType": "scorch",
         "segmentVersion": 15
        }
       },
       "sourceType": "gocbcore",
       "sourceName": "default",
       "sourceUUID": "9f032e7c4538aae118c7ea711df0d6a3",
       "sourceParams": {},
       "planParams": {
        "maxPartitionsPerPIndex": 1024,
        "numReplicas": 0,
        "indexPartitions": 1
       },
       "uuid": "577911ccb2f0b674"
      }
      

      Run the following query:

      {"indexName": "geo-index", "size": 10000000, "from": 0, "explain": false, "query": {"location": {"lon": -64.35, "lat": 19.59}, "distance": "10000km", "field": "geo"}, "fields": [], "ctl": {"consistency": {"level": "", "vectors": {}}, "timeout": 60000}, "sort": [{"by": "geo_distance", "field": "geo", "unit": "km", "location": "de6prwm"}]}
      

      Corresponding ES query:

      {'query': {'match_all': {}}, 'filter': {'geo_distance': {'distance': '10000km', 'geo': {'lat': 19.59, 'lon': -64.35}}}, 'sort': [{'_geo_distance': {'geo': 'de6prwm', 'order': 'asc', 'unit': 'km'}}]}
      

      Difference in results order will be here:

      DIFFERENCE IS IN 632 POSITION
      FTS VAL: earthquake497
      ES  VAL: earthquake806
      DIFFERENCE IS IN 633 POSITION
      FTS VAL: earthquake806
      ES  VAL: earthquake497
      

       

      Attachments

        Activity

          People

            evgeny.makarenko Evgeny Makarenko (Inactive)
            evgeny.makarenko Evgeny Makarenko (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