elasticsearch 报错: No value specified for terms query

elasticsearch 报错: No value specified for terms query,第1张

elasticsearch 报错: No value specified for terms query
Failed to execute phase [dfs], all shards failed; shardFailures {[felf1bKUSY6sbP3-1ZJCoQ][test_index][0]: RemoteTransportException[[node-3][172.20.21.37:9300][indices:data/read/search[phase/dfs]]]; nested: SearchParseException[failed to parse search source [{"from":0,"size":1000,"query":{"bool":{"filter":{"terms":{"mobileNo":["3124124312431","423142143214"]}}}}}]]; nested: QueryParsingException[No value specified for terms query]; }
    at org.elasticsearch.action.search.AbstractSearchAsyncAction.onFirstPhaseResult(AbstractSearchAsyncAction.java:206)
    at org.elasticsearch.action.search.AbstractSearchAsyncAction.onFailure(AbstractSearchAsyncAction.java:152)
    at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:46)
    at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:184)
    at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:174)
    at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:122)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.frame.frameDecoder.unfoldAndFireMessageReceived(frameDecoder.java:462)
    at org.jboss.netty.handler.codec.frame.frameDecoder.callDecode(frameDecoder.java:443)
    at org.jboss.netty.handler.codec.frame.frameDecoder.messageReceived(frameDecoder.java:303)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker.run(DeadLockProofWorker.java:42)
    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: [test_index] QueryParsingException[No value specified for terms query]
    at org.elasticsearch.index.query.TermsQueryParser.parse(TermsQueryParser.java:105)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerFilter(QueryParseContext.java:263)
    at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:91)
    at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)
    at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:324)
    at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:224)
    at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:219)
    at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
    at org.elasticsearch.search.SearchService.parseSource(SearchService.java:856)
    at org.elasticsearch.search.SearchService.createContext(SearchService.java:667)
    at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:633)
    at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:264)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:360)
    at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:357)
    at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
    at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
    at org.elasticsearch.transport.TransportService.doRun(TransportService.java:378)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
    ... 3 more

报错原因就是:  构造termsQuery查询条件的时候,比如:下边构造了一个null进去,就会报错。

QueryBuilders.termsQuery("mobileNo",  null)

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5705434.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存