Check query before sending it to data nodes


(Thomas Decaux) #1

In a typical cluster, we have a client node and data nodes.

We send query to client node, that dispatch it to data nodes.

Client node should check that the query is good (no parsing error) before sending it to data nodes (and receive the big error message for each shards ^^):

[2017-10-04 13:29:49,150][DEBUG][action.search ] [PAR-X-ESWLB02] [X][0], node[X], [P], v[3], s[STARTED], a[id=X]: Failed to execute [org.elasticsearch.action.search.SearchRequest@1f7470f6]
RemoteTransportException[[PAR-X-ESDATA03][X:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{
"aggs": {
"distinct_colors": {
"terms": {
"field.simple": "category",
"size": 1000
}
}
}
}
]]; nested: SearchParseException[Unknown key for a VALUE_STRING in [distinct_colors]: [field.simple].];
Caused by: SearchParseException[failed to parse search source [{
"aggs": {
"distinct_colors": {
"terms": {
"field.simple": "category",
"size": 1000
}
}
}
}
]]; nested: SearchParseException[Unknown key for a VALUE_STRING in [distinct_colors]: [field.simple].];
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:873)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:667)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:633)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:377)
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.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(MessageChannelHandler.java:293)
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: SearchParseException[Unknown key for a VALUE_STRING in [distinct_colors]: [field.simple].]
at org.elasticsearch.search.aggregations.bucket.terms.TermsParametersParser.parseSpecial(TermsParametersParser.java:83)
at org.elasticsearch.search.aggregations.bucket.terms.AbstractTermsParametersParser.parse(AbstractTermsParametersParser.java:87)
at org.elasticsearch.search.aggregations.bucket.terms.TermsParser.parse(TermsParser.java:54)
at org.elasticsearch.search.aggregations.AggregatorParsers.parseAggregators(AggregatorParsers.java:198)
at org.elasticsearch.search.aggregations.AggregatorParsers.parseAggregators(AggregatorParsers.java:103)
at org.elasticsearch.search.aggregations.AggregationParseElement.parse(AggregationParseElement.java:60)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:856)
... 12 more


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.