Eric_Jain
(Eric Jain)
November 17, 2014, 6:48pm
1
If you are using the "geohash grid" aggregation, and your index can contain
documents with more than one value, you may want to hold off migrating to
1.4.0 (see comment at see
https://github.com/elasticsearch/elasticsearch/issues/8512 )...
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5ce977ae-8e92-44a3-8f5e-ae78ba160ab9%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
Eric_Jain
(Eric Jain)
November 17, 2014, 7:07pm
2
On Mon, Nov 17, 2014 at 10:48 AM, Eric Jain eric.jain@gmail.com wrote:
If you are using the "geohash grid" aggregation, and your index can contain
documents with more than one value, you may want to hold off migrating to
1.4.0 [...]
The correct issue link is
opened 04:34PM - 17 Nov 14 UTC
closed 09:36AM - 20 Nov 14 UTC
>bug
Using a geohash_grid aggregation used to work on arrays of points, but with ES 1… .4.0 an exception occurs instead. The following curl commands reproduce the issue on a clean installation of ES:
```
# create index with geo_point mapping
curl -XPUT localhost:9200/test -d '{
"mappings": {
"test": {
"properties": {
"points": {
"type": "geo_point",
"geohash_prefix": true
}
}
}
}
}'
# insert documents
curl -XPUT localhost:9200/test/test/1?refresh=true -d '{ "points": [[1,2], [2,3]] }'
curl -XPUT localhost:9200/test/test/2?refresh=true -d '{ "points": [[2,3], [3,4]] }'
# perform aggregation
curl -XGET localhost:9200/test/test/_search?pretty -d '{
"size": 0,
"aggs": {
"a1": {
"geohash_grid": {
"field": "points",
"precision": 3
}
}
}
}'
```
On Elasticsearch 1.3.5 this produces the expected result:
```
...
"aggregations" : {
"a1" : {
"buckets" : [ {
"key" : "s09",
"doc_count" : 2
}, {
"key" : "s0d",
"doc_count" : 1
}, {
"key" : "s02",
"doc_count" : 1
} ]
}
}
...
```
However on Elasticsearch 1.4.0 this triggers a failure:
```
{
"took" : 76,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 3,
"failed" : 2,
"failures" : [ {
"index" : "test",
"shard" : 2,
"status" : 500,
"reason" : "QueryPhaseExecutionException[[test][2]: query[ConstantScore(cache(_type:test))],from[0],size[0]: Query Failed [Failed to execute main query]]; nested: ArrayIndexOutOfBoundsException[1]; "
}, {
"index" : "test",
"shard" : 3,
"status" : 500,
"reason" : "QueryPhaseExecutionException[[test][3]: query[ConstantScore(cache(_type:test))],from[0],size[0]: Query Failed [Failed to execute main query]]; nested: ArrayIndexOutOfBoundsException[1]; "
} ]
},
"hits" : {
"total" : 0,
"max_score" : 0.0,
"hits" : [ ]
},
"aggregations" : {
"a1" : {
"buckets" : [ ]
}
}
}
```
The log contains this exception:
```
[2014-11-17 17:28:25,121][DEBUG][action.search.type ] [Franklin Storm] [test][3], node[-S9ijRKKQH-IEAr3sUW14Q], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@1fa40d49]
org.elasticsearch.search.query.QueryPhaseExecutionException: [test][3]: query[ConstantScore(cache(_type:test))],from[0],size[0]: Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:163)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:275)
at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231)
at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228)
at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridParser$GeoGridFactory$CellValues.setDocument(GeoHashGridParser.java:154)
at org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregator.collect(GeoHashGridAggregator.java:73)
at org.elasticsearch.search.aggregations.AggregationPhase$AggregationsCollector.collect(AggregationPhase.java:161)
at org.elasticsearch.common.lucene.MultiCollector.collect(MultiCollector.java:60)
at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:193)
at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:163)
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:35)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:621)
at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:191)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:309)
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:117)
... 7 more
```
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAHte5%2B%2BpCD18VVYRaeY1mMwzbz95MXPyndAdJXfDgo8CzXg9og%40mail.gmail.com .
For more options, visit https://groups.google.com/d/optout .