Getting SearchPhraseException

I am getting the following exception:

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [query], total failure; shardFailures
{[0tdGifEsSHu06F1nr0RnKg][logstore:1:1381881600000][1]:
RemoteTransportException[[Ani-Mator][inet[/10.129.35.115:9300]][search/phase/query]];
nested: SearchParseException[[logstore:1:1381881600000][1]:
from[-1],size[100]: Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[sn4WUR-RToKK6XnNlARwCg][logstore:1:1381881600000][4]:
RemoteTransportException[[Cecilia
Reyes][inet[/10.129.34.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][4]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[iCScEUaJTOKQtiOhrUcSDw][logstore:1:1381881600000][2]:
RemoteTransportException[[Creel, Carl
"Crusher"][inet[/10.129.38.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][2]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[T1bVeKJrQUWVfjCbu483dQ][logstore:1:1381881600000][3]:
RemoteTransportException[[Portal][inet[/10.129.36.115:9300]][search/phase/query]];
nested: SearchParseException[[logstore:1:1381881600000][3]:
from[-1],size[100]: Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[iCScEUaJTOKQtiOhrUcSDw][logstore:1:1381881600000][0]:
RemoteTransportException[[Creel, Carl
"Crusher"][inet[/10.129.38.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][0]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]]; }

My code looks like:

rangeFilter =
FilterBuilders.rangeFilter(LogMessageHelper.TIMESTAMP).from(start).to(end);

sb = sc.prepareSearch(logIndex.toString())
.setTypes(LogStorageModule.LOGS_DOC_TYPE)
.setQuery(qb).setSize(logsPerPage - logs.size())
.addSort(LogMessageHelper.TIMESTAMP, SortOrder.ASC)
.setFilter(rangeFilter);

where qb is initialized as:

BytesArray qb = new BytesArray(query);

the query string is passed from the user and is like

{"term":{"message":"exception"}}

what am i doing wrong?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I don't see anything terribly wrong here. What I would is trying the build
the query too using QueryBuilders and get from the users only field name
and query, but maybe that's not possible in your case.
I think you get back an error when the query that is being passed in as a
parameter is not valid json? Can you check that?

On Wednesday, October 16, 2013 8:29:44 PM UTC+2, vinod eligeti wrote:

I am getting the following exception:

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [query], total failure; shardFailures
{[0tdGifEsSHu06F1nr0RnKg][logstore:1:1381881600000][1]:
RemoteTransportException[[Ani-Mator][inet[/10.129.35.115:9300]][search/phase/query]];
nested: SearchParseException[[logstore:1:1381881600000][1]:
from[-1],size[100]: Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[sn4WUR-RToKK6XnNlARwCg][logstore:1:1381881600000][4]:
RemoteTransportException[[Cecilia
Reyes][inet[/10.129.34.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][4]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[iCScEUaJTOKQtiOhrUcSDw][logstore:1:1381881600000][2]:
RemoteTransportException[[Creel, Carl
"Crusher"][inet[/10.129.38.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][2]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[T1bVeKJrQUWVfjCbu483dQ][logstore:1:1381881600000][3]:
RemoteTransportException[[Portal][inet[/10.129.36.115:9300]][search/phase/query]];
nested: SearchParseException[[logstore:1:1381881600000][3]:
from[-1],size[100]: Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]];
}{[iCScEUaJTOKQtiOhrUcSDw][logstore:1:1381881600000][0]:
RemoteTransportException[[Creel, Carl
"Crusher"][inet[/10.129.38.115:9300]][search/phase/query]]; nested:
SearchParseException[[logstore:1:1381881600000][0]: from[-1],size[100]:
Parse Failure [Failed to parse source
[{"size":100,"query_binary":"ZXhjZXB0aW9u","filter":{"range":{"timestamp":{"from":1381946862387,"to":1381947762387,"include_lower":true,"include_upper":true}}},"sort":[{"timestamp":{"order":"asc"}}]}]]];
nested: ElasticSearchParseException[Failed to derive xcontent from
(offset=0, length=9): [101, 120, 99, 101, 112, 116, 105, 111, 110]]; }

My code looks like:

rangeFilter =
FilterBuilders.rangeFilter(LogMessageHelper.TIMESTAMP).from(start).to(end);

sb = sc.prepareSearch(logIndex.toString())
.setTypes(LogStorageModule.LOGS_DOC_TYPE)
.setQuery(qb).setSize(logsPerPage - logs.size())
.addSort(LogMessageHelper.TIMESTAMP, SortOrder.ASC)
.setFilter(rangeFilter);

where qb is initialized as:

BytesArray qb = new BytesArray(query);

the query string is passed from the user and is like

{"term":{"message":"exception"}}

what am i doing wrong?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.