Got QueryPhaseExecutionException when using custom query parser

Hi all,

I wrote my own custom query parser, and extended elasticsearch as a plugin,
the code is in the following link.

query parser http://pastebin.mozilla.org/6172836
customized query http://pastebin.mozilla.org/6172837
plugin http://pastebin.mozilla.org/6172844

I used the default settings of Elasticsearch, and the document I PUT is
{
"test": "haha"
}
{
"test": "ahah"
}

I used the query:
{
"query": {
"backwards": {
"test": "haha"
}
}

And the error message I got is:

[2014-08-27 13:26:41,678][DEBUG][action.search.type ] [Poison]
[test][2], node[w4ORe_ERQBeOVpII3P9w1w], [P], s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@7e1416e] lastShard [true]
org.elasticsearch.search.query.QueryPhaseExecutionException: [test][2]:
query[filtered(BackwardsQuery:
test:ahah)->cache(_type:test)],from[0],size[10]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:162)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:261)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:206)
at
org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:203)
at
org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:517)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at
org.elasticsearch.backwardstermquery.BackwardsTermQuery$BackwardsScorer.docID(BackwardsTermQuery.java:118)
at
org.elasticsearch.backwardstermquery.BackwardsTermQuery$BackwardsScorer.nextDoc(BackwardsTermQuery.java:133)
at
org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:192)
at
org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:163)
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:35)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:621)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:175)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:491)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:448)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:281)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:269)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:156)
... 7 more

I am very confused of it, could someone please point out what's wrong?
Thank you so much!

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2082f731-34c5-4d92-9fe0-439cef5fdabc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.