sirensolutions / siren-join

[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]
http://siren.io
GNU Affero General Public License v3.0
183 stars 60 forks source link

Report error when field does not exist in the index #33

Closed scampi closed 8 years ago

scampi commented 8 years ago

a NPE is currently sent back to the client:

    at org.elasticsearch.search.SearchService.parseSource(SearchService.java:848)
    at org.elasticsearch.search.SearchService.createContext(SearchService.java:651)
    at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:617)
    at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:368)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
    at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:350)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at org.elasticsearch.index.fielddata.IndexFieldDataService.getForField(IndexFieldDataService.java:202)
    at org.elasticsearch.index.query.QueryParseContext.getForField(QueryParseContext.java:188)
    at solutions.siren.join.index.query.FieldDataTermsQueryParser.parse(FieldDataTermsQueryParser.java:108)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:270)
    at org.elasticsearch.index.query.ConstantScoreQueryParser.parse(ConstantScoreQueryParser.java:65)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
    at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:110)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:270)
    at org.elasticsearch.index.query.FilteredQueryParser.parse(FilteredQueryParser.java:70)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
    at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:303)
    at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:206)
    at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:201)
    at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
    at org.elasticsearch.search.SearchService.parseSource(SearchService.java:831)
    ... 10 more