# Query failes after upgrading from 0.19.2 to 0.19.4

**URL:** <https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993>\
**Category:** Elasticsearch\
**Created:** [June 6, 2012, 8:31am UTC](https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993 "2012-06-06T08:31:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FredrikNB](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@FredrikNB](https://discuss.elastic.co/u/FredrikNB)\
**Post date:** [June 6, 2012, 8:31am UTC](https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993/1 "2012-06-06T08:31:45Z")

</div>

After upgrading from Elasticsearch 0.19.2 to 0.19.4 this query failes:

{  
"from" : 0,  
"size" : 100000,  
"query" : {  
"query\_string" : {  
"query" : ""oai\:bibsys.no\:biblio\:92116324x" "oai\:bibsys.no\:biblio\:101924739" "oai\:bibsys.no\:biblio\:921163258" "oai\:bibsys.no\:biblio\:09372229x" "oai\:bibsys.no\:biblio\:921163259" ",  
"fields" : ["otherid", "oaiid", "sesamid", "isbn", "urn"]  
}  
},  
"explain" : false,  
"sort" : [ {  
"\_id" : {  
"order" : "asc"  
}  
} ]  
}

What we want, is to use the query\_string to get the exact match.

Mappings:

"otherid":{"type":"string"},  
"isbn":{"type":"string", "analyzer":"isbn"},  
"urn":{"type":"string", "index":"not\_analyzed", "boost":2.0},  
"sesamid":{"type":"string", "index":"not\_analyzed"},  
"oaiid":{"type":"string", "index":"not\_analyzed", "boost":2.0},

* * *

Elasticsearch log:

* * *

Parse Failure [Failed to parse source [{"from":0,"size":100000,"query":{"query\_string":{"query":""oai\:bibsys.no\:biblio\:92116324x" "oai\:bibsys.no\:biblio\:101924739" "oai\:bibsys.no\:biblio\:921163258" "oai\:bibsys.no\:biblio\:09372229x" "oai\:bibsys.no\:biblio\:921163259" ","fields":["otherid","oaiid","sesamid","isbn","urn"]}},"explain":false,"sort":[{"\_id":{"order":"asc"}}]}]]  
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
at org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)  
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:497)  
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:486)  
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:373)  
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:662)  
Caused by: java.lang.NullPointerException  
at org.elasticsearch.index.mapper.MapperService$SmartIndexNameSearchQuoteAnalyzer.reusableTokenStream(MapperService.java:976)  
at org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:574)  
at org.apache.lucene.queryParser.MapperQueryParser.getFieldQuerySingle(MapperQueryParser.java:238)  
at org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:186)  
at org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)  
at org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:257)  
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1580)  
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1317)  
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:206)  
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)  
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249)  
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:229)  
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)  
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:545)

* * *

As you can see we get a NullPointerException in MapperService(976) which is new code in 0.19.4. It looks like it has something to do with the searchQuoteAnalyzer().

If we remove the quotes(") around each query string, this query runs fine, but we get more hits then we want to. I guess, this is because "otherid" is not set to "not\_analyzed".

What is wrong with this query? Could this be a bug?

---

<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:** [June 10, 2012, 10:13pm UTC](https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993/2 "2012-06-10T22:13:43Z")

</div>

There is an issue open for it, and I mentioned there that it would be great  
to have a recreation

On Wed, Jun 6, 2012 at 10:31 AM, FredrikNB [frezz.software@gmail.com](mailto:frezz.software@gmail.com) wrote:

> After upgrading from Elasticsearch 0.19.2 to 0.19.4 this query failes:
> 
> {  
> "from" : 0,  
> "size" : 100000,  
> "query" : {  
> "query\_string" : {  
> "query" : ""oai\:bibsys.no\:biblio\:92116324x"  
> "oai\:bibsys.no\:biblio\:101924739"  
> "oai\:bibsys.no\:biblio\:921163258"  
> "oai\:bibsys.no\:biblio\:09372229x"  
> "oai\:bibsys.no\:biblio\:921163259" ",  
> "fields" : ["otherid", "oaiid", "sesamid", "isbn", "urn"]  
> }  
> },  
> "explain" : false,  
> "sort" : [ {  
> "\_id" : {  
> "order" : "asc"  
> }  
> } ]  
> }
> 
> What we want, is to use the query\_string to get the exact match.
> 
> Mappings:
> 
> "otherid":{"type":"string"},  
> "isbn":{"type":"string", "analyzer":"isbn"},  
> "urn":{"type":"string", "index":"not\_analyzed", "boost":2.0},  
> "sesamid":{"type":"string", "index":"not\_analyzed"},  
> "oaiid":{"type":"string", "index":"not\_analyzed", "boost":2.0},
> 
> * * *
> 
> Elasticsearch log:
> 
> * * *
> 
> Parse Failure [Failed to parse source  
> [{"from":0,"size":100000,"query":{"query\_string":{"query":""oai\:  
> bibsys.no\:biblio\:92116324x"  
> "oai\:bibsys.no\:biblio\:101924739"  
> "oai\:bibsys.no\:biblio\:921163258"  
> "oai\:bibsys.no\:biblio\:09372229x"  
> "oai\:bibsys.no\:biblio\:921163259"
> 
> ","fields":["otherid","oaiid","sesamid","isbn","urn"]}},"explain":false,"sort":[{"\_id":{"order":"asc"}}]}]]  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
> at
> 
> org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
> at
> 
> org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)  
> at
> 
> org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:497)  
> at
> 
> org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:486)  
> at
> 
> org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:373)  
> 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:662)  
> Caused by: java.lang.NullPointerException  
> at
> 
> org.elasticsearch.index.mapper.MapperService$SmartIndexNameSearchQuoteAnalyzer.reusableTokenStream(MapperService.java:976)  
> at
> 
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:574)  
> at
> 
> org.apache.lucene.queryParser.MapperQueryParser.getFieldQuerySingle(MapperQueryParser.java:238)  
> at
> 
> org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:186)  
> at
> 
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)  
> at
> 
> org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:257)  
> at  
> org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1580)  
> at  
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1317)  
> 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:206)  
> at
> 
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)  
> at
> 
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249)  
> at
> 
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:229)  
> at
> 
> org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)  
> at  
> org.elasticsearch.search.SearchService.parseSource(SearchService.java:545)
> 
> * * *
> 
> As you can see we get a NullPointerException in MapperService(976) which is  
> new code in 0.19.4. It looks like it has something to do with the  
> searchQuoteAnalyzer().
> 
> If we remove the quotes(") around each query string, this query runs fine,  
> but we get more hits then we want to. I guess, this is because "otherid" is  
> not set to "not\_analyzed".
> 
> What is wrong with this query? Could this be a bug?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Query-failes-after-upgrading-from-0-19-2-to-0-19-4-tp4018873.html](http://elasticsearch-users.115913.n3.nabble.com/Query-failes-after-upgrading-from-0-19-2-to-0-19-4-tp4018873.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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:** [June 10, 2012, 10:24pm UTC](https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993/3 "2012-06-10T22:24:00Z")

</div>

I think I managed to track down the problem, will push a fix soon on the  
mentioned issue: [Quoted query\_string gives NullPointerException with not\_analyzed field (0.19.4) · Issue #2006 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2006).

On Mon, Jun 11, 2012 at 12:13 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> There is an issue open for it, and I mentioned there that it would be  
> great to have a recreation
> 
> On Wed, Jun 6, 2012 at 10:31 AM, FredrikNB [frezz.software@gmail.com](mailto:frezz.software@gmail.com)wrote:
> 
> > After upgrading from Elasticsearch 0.19.2 to 0.19.4 this query failes:
> > 
> > {  
> > "from" : 0,  
> > "size" : 100000,  
> > "query" : {  
> > "query\_string" : {  
> > "query" : ""oai\:bibsys.no\:biblio\:92116324x"  
> > "oai\:bibsys.no\:biblio\:101924739"  
> > "oai\:bibsys.no\:biblio\:921163258"  
> > "oai\:bibsys.no\:biblio\:09372229x"  
> > "oai\:bibsys.no\:biblio\:921163259" ",  
> > "fields" : ["otherid", "oaiid", "sesamid", "isbn", "urn"]  
> > }  
> > },  
> > "explain" : false,  
> > "sort" : [ {  
> > "\_id" : {  
> > "order" : "asc"  
> > }  
> > } ]  
> > }
> > 
> > What we want, is to use the query\_string to get the exact match.
> > 
> > Mappings:
> > 
> > "otherid":{"type":"string"},  
> > "isbn":{"type":"string", "analyzer":"isbn"},  
> > "urn":{"type":"string", "index":"not\_analyzed", "boost":2.0},  
> > "sesamid":{"type":"string", "index":"not\_analyzed"},  
> > "oaiid":{"type":"string", "index":"not\_analyzed", "boost":2.0},
> > 
> > * * *
> > 
> > Elasticsearch log:
> > 
> > * * *
> > 
> > Parse Failure [Failed to parse source  
> > [{"from":0,"size":100000,"query":{"query\_string":{"query":""oai\:  
> > bibsys.no\:biblio\:92116324x"  
> > "oai\:bibsys.no\:biblio\:101924739"  
> > "oai\:bibsys.no\:biblio\:921163258"  
> > "oai\:bibsys.no\:biblio\:09372229x"  
> > "oai\:bibsys.no\:biblio\:921163259"
> > 
> > ","fields":["otherid","oaiid","sesamid","isbn","urn"]}},"explain":false,"sort":[{"\_id":{"order":"asc"}}]}]]  
> > at  
> > org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)  
> > at
> > 
> > org.elasticsearch.search.SearchService.createContext(SearchService.java:469)  
> > at
> > 
> > org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)  
> > at
> > 
> > org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:497)  
> > at
> > 
> > org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:486)  
> > at
> > 
> > org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:373)  
> > 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:662)  
> > Caused by: java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.mapper.MapperService$SmartIndexNameSearchQuoteAnalyzer.reusableTokenStream(MapperService.java:976)  
> > at
> > 
> > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:574)  
> > at
> > 
> > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuerySingle(MapperQueryParser.java:238)  
> > at
> > 
> > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:186)  
> > at
> > 
> > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)  
> > at
> > 
> > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:257)  
> > at  
> > org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1580)  
> > at  
> > org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1317)  
> > 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:206)  
> > at
> > 
> > org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:187)  
> > at
> > 
> > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:249)  
> > at
> > 
> > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:229)  
> > at
> > 
> > org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)  
> > at  
> > org.elasticsearch.search.SearchService.parseSource(SearchService.java:545)
> > 
> > * * *
> > 
> > As you can see we get a NullPointerException in MapperService(976) which  
> > is  
> > new code in 0.19.4. It looks like it has something to do with the  
> > searchQuoteAnalyzer().
> > 
> > If we remove the quotes(") around each query string, this query runs  
> > fine,  
> > but we get more hits then we want to. I guess, this is because "otherid"  
> > is  
> > not set to "not\_analyzed".
> > 
> > What is wrong with this query? Could this be a bug?
> > 
> > --  
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/Query-failes-after-upgrading-from-0-19-2-to-0-19-4-tp4018873.html](http://elasticsearch-users.115913.n3.nabble.com/Query-failes-after-upgrading-from-0-19-2-to-0-19-4-tp4018873.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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:24am UTC](https://discuss.elastic.co/t/query-failes-after-upgrading-from-0-19-2-to-0-19-4/7993/4 "2017-07-06T03:24:58Z")

</div>


