Skip to content

SearchResultHit.GeoDistanceMeter is of incorrect type #187

@rahulchander1

Description

@rahulchander1

Description

  • Am performing a query with a geo-precision search in the sort_by clause, and when the search is completed, I get the following error: json: cannot unmarshal number 421.0 into Go struct field SearchResultHit.results.hits.geo_distance_meters of type int

Steps to reproduce

Make a collection, and include a geoPoint field
My example search is below

  • Collection: campus
  • Query: *
  • Query-By: name
  • Filter: coordinates:(34.05000000,-118.44000000,50.00000000 mi), where coordinates is the geopoint field
  • Sort: coordinates(34.05000, -118.44000, precision: 5mi):asc, dateCreated:desc
  • Page: 1
  • PerPage: 5

Was able to replicate this on both single search and multi search

Expected Behavior

Would expect it to return an int OR have the object be a float

Actual Behavior

Is actually returning a float where an int is expected

Metadata

Typesense Version: typesense v27.1

Go Version: 1.21.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions