Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-581

Running geoDistanceQuery fails on passing number as distance value

    XMLWordPrintable

Details

    • 1

    Description

      After pulling code from commit JSCBC-576: Fixed GeoDistanceQuery to build example code. Example code threw an error upon attempting to run a geospatial query in the following format:

      const geo = SearchQuery.geoDistanceQuery(100,150,300);
      

      this is the correct way to set up the Query as defined by the API Docs.

      Error thrown:

      Error: An FTS error occured: {"error":"rest_index: Query, indexName: Location, err: bleve: QueryBleve parsing searchRequest, err: struct { Location interface {} \"json:\\\"location,omitempty\\\"\"; Distance string \"json:\\\"distance,omitempty\\\"\"; FieldVal string \"json:\\\"field,omitempty\\\"\"; BoostVal *query.Boost \"json:\\\"boost,omitempty\\\"\" }: Distance: ReadString: expects \" or n, but found 3, error found in #10 byte of ...|istance\":300,\"locati|..., bigger context ...|{\"distance\":300,\"location\":[100,150]}|...","request":{"ctl":{"timeout":75000},"highlight":{"fields":[null]},"indexName":"Location","query":{"distance":300,"location":[100,150]},"size":100},"status":"fail"}
      

      This error message seems to suggest an error is thrown as the function that runs FTS queries attempts to read the distance value as a string, when it is specified in the docstring that it should be passed as a number.

      Attachments

        For Gerrit Dashboard: JSCBC-581
        # Subject Branch Project Status CR V

        Activity

          People

            brett19 Brett Lawson
            isaac.lowe Isaac Lowe (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty