# 0.19.9 Parse Failture

**URL:** <https://discuss.elastic.co/t/0-19-9-parse-failture/9166>\
**Category:** Elasticsearch\
**Created:** [September 27, 2012, 7:31am UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166 "2012-09-27T07:31:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MMM](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@MMM](https://discuss.elastic.co/u/MMM)\
**Post date:** [September 27, 2012, 7:31am UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/1 "2012-09-27T07:31:40Z")

</div>

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

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 27, 2012, 8:02pm UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/2 "2012-09-27T20:02:49Z")

</div>

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](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. 🙂

Cheers,

Ivan

On Thu, Sep 27, 2012 at 12:31 AM, MMM [homer68@gmail.com](mailto: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
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 27, 2012, 8:20pm UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/3 "2012-09-27T20:20:02Z")

</div>

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](mailto:ivan@brusic.com) wrote:

> I'll let someone else debug it further. 🙂

--

---

<div class="post-metadata">

**Author:** ![MMM](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@MMM](https://discuss.elastic.co/u/MMM)\
**Post date:** [September 28, 2012, 5:09am UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/4 "2012-09-28T05:09:43Z")

</div>

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](mailto:iv...@brusic.com)\<javascript:\>
> 
> > wrote:
> > 
> > I'll let someone else debug it further. 🙂

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 28, 2012, 12:00pm UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/5 "2012-09-28T12:00:23Z")

</div>

Yea, its a bug, opened [query\_string on multiple fields with "\*" fails in 0.19.9 · Issue #2296 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2296).

On Sep 27, 2012, at 9:31 AM, MMM [homer68@gmail.com](mailto: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
> 
> --

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/0-19-9-parse-failture/9166/6 "2017-07-06T03:10:55Z")

</div>


