I have a large number (millions) of documents with geolocations in
I’m able to query based on location now, but I want to also now add in an additional filter to the search to reduce the number of documents based on a column called type, and one called deleted.
I know I can filter these in code afterwards, but I’d rather return just 10s of documents from the server, rather than 1000s
I’m using the C# SDK , just unable to figure out how to add additional column query to my GeoDistanceQuery.
You may use the compound queries like conjuncts wherein one of the child clauses will be your geo query and can have as many additional search clauses as you wish.
I managed to get this working using the following in the C# if anyone stumbles across looking for it:
var locationQuery = new GeoDistanceQuery()
.Latitude(latitudeDouble)
.Longitude(longitudeDouble)
.Distance(distanceString);
var typeMatch = new MatchQuery(typeString).Field("type");
var deleteMatch = new MatchQuery(deletedString).Field("deleted");
var query = new ConjunctionQuery(locationQuery , typeMatch, deleteMatch );