Need suitable method like writeValueAsString (boolQueryWrapper) in ObjectMapper class for prepare query with out quotes for value

Hi Team,

I have prepared this query to fetch docs from one index.

GET iso_country_index/_search?size=2000
{
    "query" : {
        "bool" : {
            "must" : [{
                "terms" : { 
                    "country_cde" : [44,99,20,24]
                }
            }]
        }
    }
}

As part of I'm java client I am using this method to create a query with code

luminis-ams/elastic-rest-spring-wrapper

this ObjectMapper.writeValueAsString(boolQueryWrapper) returns query as

GET iso_country_index/_search?size=2000
{
"query" : {
"bool" : {
"must" : [{
"terms" : {
"country_cde" : "[44,99,20,24]"
}
}]
}
}
}

here I'm getting " " for list --> "country_cde" : "[44,99,20,24]" instead of "country_cde" :
[44,99,20,24]
so I am getting error .

Thanks in advnace

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