ReduceSearchPhaseException error

I'm getting an exception when trying to run this query:

{
"sort": [
"_score",
{"created": {"reverse": true}}
],
"from": 0, "size": 10,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "thisquerydoesnotexist",
"fields": ["title", "notes", "tags"],
"default_operator": "AND",
"use_dis_max": true
}
},
"filter": {
"geo_bounding_box": {
"geo": {
"top_left" : {
"lat" : 47.55,
"lon" : -124.10
},
"bottom_right" : {
"lat" : 31.06,
"lon" : -77
}
}
}
}
}
}
}'

This only seems to happen when the query does not return any results..

Full backtrace:

[15:44:43,800][DEBUG][action.search.type ] [Hellion] [photos]
[0], node[f6c014fd-94cf-4e1e-9ecf-b1f17879603f], [P], s[STARTED]:
Failed to execute
[org.elasticsearch.action.search.SearchRequest@50fc1387] while moving
to second phase
java.lang.IllegalArgumentException: field can only be null when type
is SCORE or DOC
at org.apache.lucene.search.SortField.initFieldType(SortField.java:
217)
at org.apache.lucene.search.SortField.(SortField.java:127)
at
org.elasticsearch.search.controller.SearchPhaseController.sortDocs(SearchPhaseController.java:
106)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction
$AsyncAction.moveToSecondPhase(TransportSearchQueryThenFetchAction.java:
85)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:
218)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$100(TransportSearchTypeAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:196)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
130)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction
$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
77)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:194)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:153)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)

Can you open an issue with a curl recreation?

On Wed, Sep 8, 2010 at 1:48 AM, Andrei andrei@zmievski.org wrote:

I'm getting an exception when trying to run this query:

{
"sort": [
"_score",
{"created": {"reverse": true}}
],
"from": 0, "size": 10,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "thisquerydoesnotexist",
"fields": ["title", "notes", "tags"],
"default_operator": "AND",
"use_dis_max": true
}
},
"filter": {
"geo_bounding_box": {
"geo": {
"top_left" : {
"lat" : 47.55,
"lon" : -124.10
},
"bottom_right" : {
"lat" : 31.06,
"lon" : -77
}
}
}
}
}
}
}'

This only seems to happen when the query does not return any results..

Full backtrace:

[15:44:43,800][DEBUG][action.search.type ] [Hellion] [photos]
[0], node[f6c014fd-94cf-4e1e-9ecf-b1f17879603f], [P], s[STARTED]:
Failed to execute
[org.elasticsearch.action.search.SearchRequest@50fc1387] while moving
to second phase
java.lang.IllegalArgumentException: field can only be null when type
is SCORE or DOC
at org.apache.lucene.search.SortField.initFieldType(SortField.java:
217)
at org.apache.lucene.search.SortField.(SortField.java:127)
at

org.elasticsearch.search.controller.SearchPhaseController.sortDocs(SearchPhaseController.java:
106)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction
$AsyncAction.moveToSecondPhase(TransportSearchQueryThenFetchAction.java:
85)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:
218)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$100(TransportSearchTypeAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$3.onResult(TransportSearchTypeAction.java:196)
at

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:
130)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction

$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:
77)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:194)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction.access$000(TransportSearchTypeAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction
$BaseAsyncAction$1.run(TransportSearchTypeAction.java:153)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)

Do I need to a sample set of indexed documents or just the query (with
curl)?

-Andrei

On Sep 8, 1:54 am, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you open an issue with a curl recreation?

On Wed, 2010-09-08 at 11:05 -0700, Andrei wrote:

Do I need to a sample set of indexed documents or just the query (with
curl)?

Give a sample doc. Enough to create a test case starting from a fresh
install.

clint

Done.

-Andrei

On Sep 8, 11:11 am, Clinton Gormley clin...@iannounce.co.uk wrote:

On Wed, 2010-09-08 at 11:05 -0700, Andrei wrote:

Do I need to a sample set of indexed documents or just the query (with
curl)?

Give a sample doc. Enough to create a test case starting from a fresh
install.

clint

just pushed a fix for this.

On Thu, Sep 9, 2010 at 12:58 AM, Andrei andrei@zmievski.org wrote:

Done.

Search failure when no results are found and sorting by score · Issue #362 · elastic/elasticsearch · GitHub

-Andrei

On Sep 8, 11:11 am, Clinton Gormley clin...@iannounce.co.uk wrote:

On Wed, 2010-09-08 at 11:05 -0700, Andrei wrote:

Do I need to a sample set of indexed documents or just the query (with
curl)?

Give a sample doc. Enough to create a test case starting from a fresh
install.

clint