Hi,
I am getting the following exception while executing a has_child query in Embedded Elastic Search Server.
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:526)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:502)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:409)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:382)
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:323)
at pan.apps.canary.historic_tag_manager.es.TagESManager.searchES(TagESManager.java:102)
... 25 more
Suppressed: org.elasticsearch.client.ResponseException: POST http://localhost:9205/malware/sample/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&search_type=dfs_query_then_fetch&batched_reduce_size=512: HTTP/1.1 400 Bad Request
{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [has_child]","line":1,"col":87}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"dfs","grouped":true,"failed_shards":[{"shard":0,"index":"test","node":"6lyIguURRr6xfze5TFvDAA","reason":{"type":"parsing_exception","reason":"no [query] registered for [has_child]","line":1,"col":87}}]},"status":400}
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:354)
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:343)
at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)
at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:748)
This happens only while using an embedded server.
The following is the query used.
"bool": {
"filter": {
"bool": {
"must": [
{
"bool": {
"must_not": {
"has_child": {
"type": "sample_plus",
"filter": {
"terms": {
"tag": [
"abc"
]
}
}
}
}
}
},
{
"bool": {
"filter": {
"term": {
"sample_id": "12345678"
}
}
}
}
]
}
}
}
}```