0.19.9 Parse Failture

Hello,

I have a problem after update on new version (0.19.8 -> 0.19.9)

This Query was working on 0.19.8, but in 0.19.9 it throwes a
SearchParseException:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description",
"synonyms"
]
}
}
]
}
}
}

It seems to have a problems with query_string queries with more fields.
Because if I have only one field in fields array, it's working:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description"
]
}
}
]
}
}
}

Can you tell me where the problem can be?

Exception:
org.elasticsearch.search.SearchParseException: [test2][3]:
from[0],size[50]: Parse Failure [Failed to parse source
[{"from":0,"size":50,"query":{"bool":{"must":[{"query_string":{"query":"*","field
s":["description","synonyms"]}}]}}}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
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:619)
Caused by: java.lang.NullPointerException
at
org.apache.lucene.queryParser.MapperQueryParser.getWildcardQuery(MapperQueryParser.java:552)
at
org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
at
org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1319)
at
org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1245)
at
org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1234)
at
org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:212)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at
org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:82)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:265)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:245)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:542)
... 10 more

thanks

--

The actual error is buried in the stack trace:

Caused by: java.lang.NullPointerException
at
org.apache.lucene.queryParser.MapperQueryParser.getWildcardQuery(MapperQueryParser.java:552)
at
org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
at
org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1319)

There were a few changes to MapperQueryParser.java prior to the release of
0.19.9:

https://github.com/elasticsearch/elasticsearch/commits/master/src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java

My guess is that this code is throwing a null pointer exception:

field.equals(this.field)

I'll let someone else debug it further. :slight_smile:

Cheers,

Ivan

On Thu, Sep 27, 2012 at 12:31 AM, MMM homer68@gmail.com wrote:

Hello,

I have a problem after update on new version (0.19.8 -> 0.19.9)

This Query was working on 0.19.8, but in 0.19.9 it throwes a
SearchParseException:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description",
"synonyms"
]
}
}
]
}
}
}

It seems to have a problems with query_string queries with more fields.
Because if I have only one field in fields array, it's working:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description"
]
}
}
]
}
}
}

Can you tell me where the problem can be?

Exception:
org.elasticsearch.search.SearchParseException: [test2][3]:
from[0],size[50]: Parse Failure [Failed to parse source
[{"from":0,"size":50,"query":{"bool":{"must":[{"query_string":{"query":"*","field
s":["description","synonyms"]}}]}}}]]
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
at
org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
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:619)
Caused by: java.lang.NullPointerException
at
org.apache.lucene.queryParser.MapperQueryParser.getWildcardQuery(MapperQueryParser.java:552)
at
org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
at
org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1319)
at
org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1245)
at
org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1234)
at
org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
at
org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:212)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at
org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:82)
at
org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:265)
at
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:245)
at
org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at
org.elasticsearch.search.SearchService.parseSource(SearchService.java:542)
... 10 more

thanks

--

--

Well, since I had the code open, I couldn't help looking into it more.

this.field is only called from three places, none of which appear to apply
to arrays:

    this.field = settings.defaultField();

    if (settings.fields() != null) {
        if (settings.fields.size() == 1) {
            // just mark it as the default field
            this.field = settings.fields().get(0);
        } else {
            // otherwise, we need to have the default field being

null...
this.field = null;
}
}

The field field was never used previously, so the last checkin exposed the
issue. I haven't stepped through the code in a debugger, but that's my
guess.

--
Ivan

On Thu, Sep 27, 2012 at 1:02 PM, Ivan Brusic ivan@brusic.com wrote:

I'll let someone else debug it further. :slight_smile:

--

That means? Bug?

On Thursday, September 27, 2012 10:20:06 PM UTC+2, Ivan Brusic wrote:

Well, since I had the code open, I couldn't help looking into it more.

this.field is only called from three places, none of which appear to apply
to arrays:

    this.field = settings.defaultField();

    if (settings.fields() != null) {
        if (settings.fields.size() == 1) {
            // just mark it as the default field
            this.field = settings.fields().get(0);
        } else {
            // otherwise, we need to have the default field being 

null...
this.field = null;
}
}

The field field was never used previously, so the last checkin exposed the
issue. I haven't stepped through the code in a debugger, but that's my
guess.

--
Ivan

On Thu, Sep 27, 2012 at 1:02 PM, Ivan Brusic <iv...@brusic.com<javascript:>

wrote:

I'll let someone else debug it further. :slight_smile:

--

Yea, its a bug, opened query_string on multiple fields with "*" fails in 0.19.9 · Issue #2296 · elastic/elasticsearch · GitHub.

On Sep 27, 2012, at 9:31 AM, MMM homer68@gmail.com wrote:

Hello,

I have a problem after update on new version (0.19.8 -> 0.19.9)

This Query was working on 0.19.8, but in 0.19.9 it throwes a SearchParseException:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description",
"synonyms"
]
}
}
]
}
}
}

It seems to have a problems with query_string queries with more fields. Because if I have only one field in fields array, it's working:
{
"from": 0,
"size": 50,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"fields": [
"description"
]
}
}
]
}
}
}

Can you tell me where the problem can be?

Exception:
org.elasticsearch.search.SearchParseException: [test2][3]: from[0],size[50]: Parse Failure [Failed to parse source [{"from":0,"size":50,"query":{"bool":{"must":[{"query_string":{"query":"*","field
s":["description","synonyms"]}}]}}}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:554)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:192)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:178)
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:619)
Caused by: java.lang.NullPointerException
at org.apache.lucene.queryParser.MapperQueryParser.getWildcardQuery(MapperQueryParser.java:552)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1319)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1245)
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1234)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
at org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:212)
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:82)
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:265)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:245)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:542)
... 10 more

thanks

--

--