-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support for (alternative for) GeoShapeQuery #8169
Comments
Hi @arthurvb, the |
For those also stumble across this problem, this cannot be accomplished with The
However, the behavior I see is different from what I expected. I tried the following code snippet. // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html
var filter = new
{
geo_shape = new
{
location = new
{
shape = geometryCollection,
relation = "within"
}
}
};
var queryString = JsonSerializer.Serialize(filter);
var result = await _client.SearchAsync<Prospect>(s => s
.Query(q => q.RawJson(new RawJsonQuery(queryString))) // Line of code in question
// .Query(new RawJsonQuery(queryString))) An alternative way, but same result
); Current BehaviorHowever the generated query was the following. {
"query": {
"raw_json": { // The "raw_json" query type does not exist. I'm pretty sure this is not intended behavior.
"geo_shape": {
"location": {
"shape": {
"type": "GeometryCollection",
"geometries": [
{
"type": "MultiPolygon",
"coordinates": [
// skip for brevity
]
}
]
},
"relation": "within"
}
}
}
}
} Expected Behavior{
"query": {
"geo_shape": {
"location": {
"shape": {
"type": "GeometryCollection",
"geometries": [
{
"type": "MultiPolygon",
"coordinates": [
// skip for brevity
]
}
]
},
"relation": "within"
}
}
}
} |
Is your feature request related to a problem? Please describe.
We want to port our (Nest) Elastic API to the v8. Currently we use the
GeoShapeQuery
, mapping to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html . However it seems that in the latest version we cannot create this query type.Describe the solution you'd like
A way to create GeoShapeQuery's in the latest C# Elastic Client API
Describe alternatives you've considered
Looking at bounding boxes, geopolygon queries, but they all have different semantics
Additional context
Many thanks in advance!
The text was updated successfully, but these errors were encountered: