Ошибка please use TotalHitCountCollector if you just need the total hit count


(Maksym Seleznev) #1

часто падает такая ошибка но не знаю на какой запрос, можно как то отследить и что за сообщение в виде " IllegalArgumentException[numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count"?

что за TotalHitCountCollector? подсчет сколько записей нашел запрос делаю

[2016-08-25 04:07:32,416][DEBUG][action.search            ] [node-1] All shards failed for phase: [query]
RemoteTransportException[[node-1][10.0.2.253:9300][indices:data/read/search[phase/query]]]; nested: QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: IllegalArgumentException[numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count];
Caused by: QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: IllegalArgumentException[numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count];
	at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:415)
	at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:130)
	at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:273)
	at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:285)
	at org.elasticsearch.search.action.SearchTransportService$SearchQueryTransportHandler.messageReceived(SearchTransportService.java:315)
	at org.elasticsearch.search.action.SearchTransportService$SearchQueryTransportHandler.messageReceived(SearchTransportService.java:312)
	at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:66)
	at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:382)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:452)
	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.IllegalArgumentException: numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count
	at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:489)
	at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:232)
	... 13 more

(Igor Motov) #2

(system) #3