Issue Statement
The typing at https://github.com/typesense/typesense-js/blob/master/lib/Typesense/Documents.d.ts#L71 is too strict on location. The actual field name depends on the actual collection definition.
Expected Behavior
Either the typing is more lenient allowing [k:string|: number or some generic parameterization is provided to dynamically define the actual geo_distance_meters property name.
Reproduction Scenario
We have a collection with defined with:
name: coordinates
type: geopoint
facet: false
index: true
infix: false
optional: true
sort: true
stem: false
store: true
As a result, our filtering and sorting requires to go by:
"filter_by": "coordinates:(59.1, 9.2, 100km)"
"sort_by": "coordinates(59.1, 9.2):asc"
And this finally creates outputs defining the geo_distance_meters on hits as:
"geo_distance_meters": {
"coordinates": 95432
}
Issue Statement
The typing at https://github.com/typesense/typesense-js/blob/master/lib/Typesense/Documents.d.ts#L71 is too strict on
location. The actual field name depends on the actual collection definition.Expected Behavior
Either the typing is more lenient allowing
[k:string|: numberor some generic parameterization is provided to dynamically define the actualgeo_distance_metersproperty name.Reproduction Scenario
We have a collection with defined with:
As a result, our filtering and sorting requires to go by:
And this finally creates outputs defining the
geo_distance_meterson hits as: