-
Notifications
You must be signed in to change notification settings - Fork 1.2k
GeoDistanceQuery throws "The given key 'Text' was not present in the dictionary" or "Unable to locate factory for multi-item union accepting a string value" #8513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi once again Here is my CreateGeoLocation function
|
Hi @tudordumitriu, Regarding 8.x: It seems like the object is not correctly serialized. This will be fixed in 8.19 since I plan to backport all 9.0 changes to the 8.x branch with that version. Regarding 9.x: Are you trying to manually deserialize the
Edit: It looks like Will be fixed in 9.0.2 (and backported to 8.19 once that's available). |
Hi @flobernd For now just commented out the serialization attribute, because we don't need the field and it works. Even though in our case the field was just a string, so don't quite get it why would it be converted internally to GeoLocation when there is no explicit conversion nor declaration |
Hi @tudordumitriu , thanks for reporting back to this issue.
This sounds really weird. Would it be ok for you to share that part of your document type and the exact query code you use to retrieve the results? |
Elastic.Clients.Elasticsearch version**: 8.18.0
Elasticsearch version: 8.16.0
.NET runtime version: 8.0.15
Operating system version: Windows 11
Description of the problem including expected versus actual behavior:
We are trying to execute a GeoDistanceQuery against a geo_point that has data stored as text in the following format
"25.76,-80.36"
The 2 errors are generated from trying to set the query location parameter from GeoLocation.Text(location) or
GeoLocation.LatitudeLongitude(new LatLonGeoLocation { Lat = lat, Lon = lon })
So any attempt results in failure.
Side notes:
We have even tried upgrading to 9.0.1 but we ran into #8512 but the good news is that with the proper code adjustments the generated query from debug view runs just fine in Postman (so only the header is stopping it from completing successfully)
Steps to reproduce:
1.Create geofilter
2.Set filter to query
3. Executed query
4. Exception thrown: "The given key 'Text' was not present in the dictionary" or "Unable to locate factory for multi-item union accepting a string value"
Expected behavior
Getting a filtered result since the the filter is applied only when there is a proximity search parameter set
The text was updated successfully, but these errors were encountered: