Hi Typesense team :wave:, I'm currently working on...
# community-help
d
Hi Typesense team ๐Ÿ‘‹, I'm currently working on a project where each document represents a product available in multiple hospitals. Here's a simplified version of my schema: { "name": "...", "enable_nested_fields": true, "fields": [ ... { "name": "hospitals_price", "type": "object[]", "fields": [ { "name": "hospital_id", "type": "int32" }, { "name": "hospital_name", "type": "string" }, { "name": "hospital_location", "type": "geopoint" } ] } ] } Each product has a hospitals_price array with associated hospital information and a hospital_location (as a geopoint). I'm trying to filter documents using a geolocation radius filter like this: filter_by = "hospitals_price.hospital_location:(-0.1919, 0.892, 500.0 km)" sort_by = "hospitals_price.hospital_location(-0.1919, 0.892):asc" But I receive the following error: RequestMalformed: [Errno 400] Error with filter field `hospitals_price.hospital_location`: Numerical field has an invalid comparator. I understand that geospatial operations work fine when the geopoint field is at the root level, but it seems they donโ€™t work when the geopoint is inside an object[]. โ“My Questions: 1. Is it currently not supported to use filter_by on a geopoint field inside an array of objects? 2. Is there a planned feature or workaround to support this kind of filtering? 3. Would you recommend flattening the structure and duplicating documents for each hospital as a workaround? Thanks in advance ๐Ÿ™ Looking forward to your thoughts!
f
By default, Typesense will auto-infer object subfields. Also, your schema definition does not use dot notation for the object subfields. Try using dot notation and marking that geo field as facetable