Error in wrapper query builder, java api, Highlevel client

I got a error when passing a json query in WrapperQueryBuilder() method in java api. code as below

SearchResponse response = client.search(new SearchRequest(index)
.source(
new SearchSourceBuilder()
.query(new WrapperQueryBuilder("{ "{ "bool": { "must": [ { "range": { "@timestamp": { "gte": "02-02-2018", "lte": "05-02-2018","format": "MM-dd-yyyy" } }} ],"must_not": [ {"term": { "level.keyword": { "value":"Information" }}}]}}"
))

)

i got error as below :
There was an unexpected error (type=Internal Server Error, status=500).
Chunk ["lte": "05-02-2018"] is not a valid entry

I need to add 2 filters in query section as json. 1st one for filtering the range and 2nd one for ignoring field value s "information". How can do it ?

Hi,
do you have the full stacktrace of that exception? Could you please post it?

error part of log as below

Date_Histogram_Format=MM-dd-YYYY,Date_Histogram_Interval=1d,Min_Doc_Count=1,Aggregation_Type=DateHistogram_Term_Term,FilterQuery={ "bool": { "must": [ { "range": { "@timestamp": { "gte": "02-02-2018", "lte": "05-02-2018", "format": "MM-dd-yyyy" } }} ],"must_not": [ {"term": { "level.keyword": { "value": "Information" } }} ] }}
2018-05-11 06:08:39,569 42928 [http-nio-9049-exec-1] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [java.lang.String com.smiforce.affero.host.rest.CommandReceiver.AggReceiver(java.lang.String) throws java.io.IOException]
2018-05-11 06:08:39,570 42929 [http-nio-9049-exec-1] DEBUG o.s.web.servlet.DispatcherServlet - Last-Modified value for [/affero-host/aggregation/Index=winlogbeat,Main_Aggregation_FieldName=@timestamp,Sub_Aggregation_FieldName=log_name.keyword,Sub_Aggregation_FieldName2=level.keyword,Date_Histogram_Format=MM-dd-YYYY,Date_Histogram_Interval=1d,Min_Doc_Count=1,Aggregation_Type=DateHistogram_Term_Term,FilterQuery=%7B%20%22bool%22:%20%7B%20%22must%22:%20[%20%7B%20%22range%22:%20%7B%20%22@timestamp%22:%20%7B%20%22gte%22:%20%2202-02-2018%22,%20%22lte%22:%20%2205-02-2018%22,%20%22format%22:%20%22MM-dd-yyyy%22%20%7D%20%7D%7D%20],%22must_not%22:%20[%20%7B%22term%22:%20%7B%20%22level.keyword%22:%20%7B%20%22value%22:%20%22Information%22%20%7D%20%7D%7D%20]%20%7D%7D] is: -1
2018-05-11 06:08:39,658 43017 [http-nio-9049-exec-1] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [java.lang.String com.smiforce.affero.host.rest.CommandReceiver.AggReceiver(java.lang.String) throws java.io.IOException]: java.lang.IllegalArgumentException: Chunk ["lte": "05-02-2018"] is not a valid entry
2018-05-11 06:08:39,660 43019 [http-nio-9049-exec-1] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [java.lang.String com.smiforce.affero.host.rest.CommandReceiver.AggReceiver(java.lang.String) throws java.io.IOException]: java.lang.IllegalArgumentException: Chunk ["lte": "05-02-2018"] is not a valid entry
2018-05-11 06:08:39,663 43022 [http-nio-9049-exec-1] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [java.lang.String com.smiforce.affero.host.rest.CommandReceiver.AggReceiver(java.lang.String) throws java.io.IOException]: java.lang.IllegalArgumentException: Chunk ["lte": "05-02-2018"] is not a valid entry
2018-05-11 06:08:39,698 43057 [http-nio-9049-exec-1] DEBUG o.s.web.servlet.DispatcherServlet - Could not complete request
java.lang.IllegalArgumentException: Chunk ["lte": "05-02-2018"] is not a valid entry

i am using spring gradle to do rest functionality.

I wonder if this error comes from Elasticsearch, do you see anything in the Elasticsearch logs? The logs that you have posted are from the client side as far as I understand.

from where can i get elastic log ? location ?

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