AI OnAI Off
Could you use the WithinDistanceFrom method?
query.Filter(p => p.Locations.WithinDistanceFrom(x.Locations, kilometers.Kilometers()));
When I attempt to index a list of GeoLocations, they do not get indexed in Find as a geolocation, they are missing the "$$geo" portion of the name. So I see this in the json:
"TestLocations": [
{
"lat": 39.9608,
"lon": -82.9912
},
{
"lat": 39.9605,
"lon": -82.9911
}
],
instead of this:
"Location$$geo": {
"lat": 39.9605,
"lon": -82.9911
}
I can add another layer, so insead of creating a List<GeoLocation>, I create another class TestLocation that only contains a GeoLocation property, then generate a List<TestLocaton>. This gives me the following json:
"TestLocations": [
{
"Location$$geo": {
"lat": 39.9593,
"lon": -83.0226
},
"$type": "ProviderData.TestLocation, xxxx",
"___types": [
"ProviderData.TestLocation",
"System.Object"
]
},
{
"Location$$geo": {
"lat": 40.1122,
"lon": -82.947
},
"$type": "ProviderData.TestLocation, xxxx",
"___types": [
"ProviderData.TestLocation",
"System.Object"
]
}
],
I tried using Nested2Find, but get the following error:
The remote server returned an error: (400) Bad Request.
SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[IoCuZPkvTjaUn5al-iMxgQ][xxxxx][0]: RemoteTransportException[[use1dfindprod01esd02][inet[/10.53.4.6:9300]][search/phase/query]]; nested: SearchParseException
Without using Nested2Find, I'm not sure how to access the nested data.
I am also trying to achieve something similar. Did anyone get this to work?
Hi,
I have an object which contains a list of geographic locations as this:
This list is being correctly (as far as I can see) indexed by EPiServer Find.
I would then like to use the Within method for each of the locations in the Locations-list to check if any of them are within the specified polygon specified in the Within method.
I've tried using MatchContained, which not really is an option - and also tried using Nested2Find (changing the Location-list to NestedList using as follows:
query.Filter(x => x.Locations, l => l.Within((IEnumerable) bounds));
but this throws an exception saying:
Any ideas on how to accomplish what I'm looking for ?