-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Probably a bug in GeoShape filter #776
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
Hey @mikeerrecart, I'm looking into this. Would you mind posting your mapping, version of NEST, and version of ES? |
Hey @gmarz, no problem. I'm using NEST 1.0.0.beta1 and ES 1.2.1 Here's the relevant part (GeoShapeLocation field) of the mapping (the entire mapping is quite big) {
"properties": {
"Description": {
"type": "string",
"index": "analyzed",
"analyzer" : "french"
},
"GeoShapeLocation" : {
"type" : "geo_shape",
"tree": "quadtree",
"precision": "1m"
}
}
} |
@mikeerrecart So the issue here is indeed with NEST. Take a look at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-shape-type.html. Coordinates are structured differently depending on the type (i.e. linestring vs polygon). Some take an array, some take an array of arrays, others take an array of array of arrays, etc... As you've discovered, NEST right now only supports the array of array case, which only covers linestring, multipoint, and envelope. We'll work on a fix for this and will keep you posted. Great catch- thank you for finding this. |
@gmarz Thanks, i'll wait for the fix. |
@mikeerrecart this is fixed now. The API has changed a bit and now accounts for all the different shapes that ES supports. Here's how you would execute your above example with the new API:
For full examples of both geoshape queries and filters, take a look at the following tests: |
@gmarz Thanks so much. I'm waitin gfor the nuget package now ;) |
Hi, Not sure where the bug lies but here's what i came into.
The following code (a GeoShape filtered query) :
generates the following JSon :
and an 400 error in NEST.
Executing the Json directly in ES generates a null pointer exception. To be able to execute the query i have to add an indentation level in the "coordinates" field like in the following Json (i wrapped all the "coordinates" field value in []
This query works like a charm, but is impossible to reproduce using Nest, the
Coordinates
method of the GeoShape filter takes aIEnumerable<IEnumerable<double>>
parameter, not aIEnumerable<IEnumerable<IEnumerable<double>>>
parameter.Is the bug in Nest ? My code ? ES ?
Thanks in advance !
Mike
The text was updated successfully, but these errors were encountered: