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

[N1QL + FTS]: Geo polygon query errors when FTS index type mapping is not dynamic

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Build: 6.5.1-6255
      Load dataset : earthquakes.json
      Create geo index:

      {
        "type": "fulltext-index",
        "name": "geo-index",
        "uuid": "18018c274a71ce22",
        "sourceType": "couchbase",
        "sourceName": "default",
        "sourceUUID": "fe92886e164fb487bd0588e0cbee9307",
        "planParams": {
          "maxPartitionsPerPIndex": 171,
          "indexPartitions": 6
        },
        "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": false
            },
            "default_type": "_default",
            "docvalues_dynamic": true,
            "index_dynamic": true,
            "store_dynamic": false,
            "type_field": "_type",
            "types": {
              "earthquake": {
                "dynamic": false,
                "enabled": true,
                "properties": {
                  "geo": {
                    "dynamic": false,
                    "enabled": true,
                    "fields": [
                      {
                        "docvalues": true,
                        "include_in_all": true,
                        "index": true,
                        "name": "geo",
                        "type": "geopoint"
                      }
                    ]
                  }
                }
              }
            }
          },
          "store": {
            "indexType": "scorch"
          }
        },
        "sourceParams": {}
      }
      

      FTS query works but n1fty does not.

      FTS query : curl -XPOST -H "Content-Type: application/json" -u Administrator:password http://172.23.121.67:8094/api/index/geo-index/query -d '{"indexName": "geo-index", "from": 0, "fields": [], "explain": false, "ctl": {"timeout": 60000, "consistency": {"vectors": {}, "level": ""}}, "query": {"field": "geo", "polygon_points": [[-114.3743815113394, -46.756982267321966], [-171.67868606878855, -34.891248202060254], [0.558522625476428, 5.685980523172349], [-172.20567966652095, 16.806670889816562], [-165.0713403863565, 21.90009335800352], [6.011138275654218, 34.87519871500005], [-158.36147054304362, 41.645180713848376], [-118.62199373073707, 60.752915311361996], [-111.24391216054889, 17.93949563772368]]}, "size": 10000000}' 
       
      N1FTY: select meta().id from default where type='earthquake' and search(default, {"field": "geo", "polygon_points": [[-114.3743815113394, -46.756982267321966], [-171.67868606878855, -34.891248202060254], [0.558522625476428, 5.685980523172349], [-172.20567966652095, 16.806670889816562], [-165.0713403863565, 21.90009335800352], [6.011138275654218, 34.87519871500005], [-158.36147054304362, 41.645180713848376], [-118.62199373073707, 60.752915311361996], [-111.24391216054889, 17.93949563772368]]})
      

      Both the queries works if you update the type mapping in the index to dynamic.

      Attachments

        1. earthquakes.json
          245 kB
          Girish Benakappa

        Issue Links

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

          Activity

            People

              girish.benakappa Girish Benakappa
              girish.benakappa Girish Benakappa
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty