Hi,

I hit exactly the same issue today. It seems that the problem occurs when 
the number of buckets in the outer geohash grid aggregation goes above a 
certain number (around 50 in my tests but that could be system dependent). 
The stack trace is below but doesn't tell much. If someone can confirm this 
is a bug I am happy to raise an issue.

[2014-09-02 14:46:54,698][DEBUG][action.search.type       ] [3-D Man] 
[typename][0], node[sEDEsE4GQ2yqxVb5njslDQ], [P], s[STARTED]: Failed to 
execute [org.elasticsearch.action.search.SearchRequest@37a97844] lastShard 
[true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [typename][0]: 
query[filtered(filtered(fieldname:other)->*:*)->cache(_type:indexname)],from[0],size[10]:
 
Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at 
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
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
[2014-09-02 14:46:54,699][DEBUG][action.search.type       ] [3-D Man] 
[typename][3], node[sEDEsE4GQ2yqxVb5njslDQ], [P], s[STARTED]: Failed to 
execute [org.elasticsearch.action.search.SearchRequest@37a97844] lastShard 
[true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [typename][3]: 
query[filtered(filtered(fieldname:other)->*:*)->cache(_type:indexname)],from[0],size[10]:
 
Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at 
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
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
[2014-09-02 14:46:54,707][DEBUG][action.search.type       ] [3-D Man] 
[typename][4], node[sEDEsE4GQ2yqxVb5njslDQ], [P], s[STARTED]: Failed to 
execute [org.elasticsearch.action.search.SearchRequest@37a97844] lastShard 
[true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [typename][4]: 
query[filtered(filtered(fieldname:other)->*:*)->cache(_type:indexname)],from[0],size[10]:
 
Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at 
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
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
[2014-09-02 14:46:54,708][DEBUG][action.search.type       ] [3-D Man] 
[typename][1], node[sEDEsE4GQ2yqxVb5njslDQ], [P], s[STARTED]: Failed to 
execute [org.elasticsearch.action.search.SearchRequest@37a97844] lastShard 
[true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [typename][1]: 
query[filtered(filtered(fieldname:other)->*:*)->cache(_type:indexname)],from[0],size[10]:
 
Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at 
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
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
[2014-09-02 14:46:54,713][DEBUG][action.search.type       ] [3-D Man] 
[typename][2], node[sEDEsE4GQ2yqxVb5njslDQ], [P], s[STARTED]: Failed to 
execute [org.elasticsearch.action.search.SearchRequest@37a97844]
org.elasticsearch.search.query.QueryPhaseExecutionException: [typename][2]: 
query[filtered(filtered(fieldname:other)->*:*)->cache(_type:indexname)],from[0],size[10]:
 
Query Failed [Failed to execute main query]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at 
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at 
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
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
[2014-09-02 14:46:54,714][DEBUG][action.search.type       ] [3-D Man] All 
shards failed for phase: [query]


On Friday, July 25, 2014 2:47:39 PM UTC+1, Colin Goodheart-Smithe wrote:
>
> Could you post the full stack trace from the elasticsearch log file? This 
> will help in working out where the query falls over
>
> Thanks
>
> On Friday, 25 July 2014 01:18:49 UTC+1, svartalf wrote:
>>
>> It is really odd, but it failed for me on the precision levels 6 and 7 
>> with a ArrayIndexOutOfBoundsException, and working for 5 and 8 levels.
>>
>> I had put a big query examples here: 
>> https://gist.github.com/svartalf/5db600e7ea2907fbda3a
>>
>>
>> четверг, 24 июля 2014 г., 18:05:30 UTC+9 пользователь Colin 
>> Goodheart-Smithe написал:
>>>
>>> I think the problem is that you have an extra aggregations object 
>>> surrounding the geo_bounds aggregation.  Try the following:
>>>
>>> curl -XGET "http://localhost:9200/postings/_search"; -d'
>>> {
>>>     "query": {
>>>         "filtered": {
>>>             "filter": {
>>>                 "geo_bounding_box": {
>>>                     "point": {
>>>                         "bottom_right": [
>>>                             104.45856200712711,
>>>                             52.208730692828844
>>>                         ],
>>>                         "top_left": [
>>>                             104.19077025908017,
>>>                             52.34035674074375
>>>                         ]
>>>                     }
>>>                 }
>>>             },
>>>             "query": {
>>>                 "match_all": {}
>>>             }
>>>         }
>>>     },
>>>     "aggregations": {
>>>         "cells": {
>>>             "geohash_grid": {
>>>                 "field": "point",
>>>                 "precision": 6
>>>             },
>>>             "aggregations": {
>>>                 "lat": {
>>>                     "avg": {
>>>                       "script": "doc[\"point\"].lat"
>>>                     }
>>>                 },
>>>                 "lon": {
>>>                     "avg": {
>>>                       "script": "doc[\"point\"].lon"
>>>                     }
>>>                 },
>>>                 "hits": {
>>>                     "top_hits": {
>>>                         "_source": {
>>>                             "include": [
>>>                                 "short_description"
>>>                             ]
>>>                         },
>>>                         "size": 1
>>>                     }
>>>                 },
>>>                 "bounds": {
>>>                     "geo_bounds": {
>>>                         "field": "point"
>>>                     }
>>>                 }
>>>             }
>>>         }
>>>     },
>>>     "size": 0
>>> }'
>>>
>>> On Thursday, 24 July 2014 09:32:10 UTC+1, svartalf wrote:
>>>>
>>>> Here is an example: 
>>>> https://gist.github.com/svartalf/c3cb76c40dd4fa1374fa
>>>>
>>>> I'm using two inner aggregation functions, and with "top_hits" removed, 
>>>> "geo_bounds" works sometimes, and sometimes fails with a `response_2.json` 
>>>> (in the example) or `response_3.json`.
>>>> With an enabled "top_hits" aggregator it is also throwing 
>>>> `response_1.json` text.
>>>>
>>>> I'm trying to group points into the buckets and annotate them with a 
>>>> top_hit item and geo bounds for each bucket, and got stuck a little. Maybe 
>>>> I should move one of those two aggregations one level deeper?
>>>>
>>>> четверг, 24 июля 2014 г., 16:52:01 UTC+9 пользователь Colin 
>>>> Goodheart-Smithe написал:
>>>>>
>>>>> You should be able to achieve this with the below query.  If you still 
>>>>> cannot get it working could you provide a cURL example which reproduces 
>>>>> your issue?
>>>>>
>>>>> curl -XGET "http://localhost:9200/geo/_search"; -d'
>>>>> {
>>>>>   "size": 0,
>>>>>   "aggs": {
>>>>>     "geohash" : {
>>>>>       "geohash_grid": {
>>>>>         "field": "location",
>>>>>         "precision": 3
>>>>>       },
>>>>>       "aggs": {
>>>>>         "subbounds": {
>>>>>           "geo_bounds": {
>>>>>             "field": "location"
>>>>>           }
>>>>>         }
>>>>>       }
>>>>>     }
>>>>>   }
>>>>> }'
>>>>>
>>>>> On Thursday, 24 July 2014 07:46:31 UTC+1, svartalf wrote:
>>>>>>
>>>>>> Is there any way to use geo_bounds as a sub aggregator?
>>>>>>
>>>>>> I have a geohash_grid aggregation, and it will be very useful to get 
>>>>>> bounds for each bucket of the data.
>>>>>> Right now my ES 1.3.0 says that he "Could not find aggregator type 
>>>>>> [bounds] in [aggregations]]".
>>>>>>
>>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/599912f7-7280-4f5a-8400-4eed0a587385%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to