Search null value as well other value


(Rahul Kumar) #1

I have a query regarding null search.
i have a Set which have other value as well null value. I want to get all the documents where a particular field is null or have values both. For e. g. i have field named feedback which have below possible values,
feedback=positive,negative and it contain null as well.
i want to get all those docs where feedback ==null or feedback=positve or feedback=negative.

I'm trying this
BoolQueryBuilder query = QueryBuilders.boolQuery()
query.mustNot(new ExistsQueryBuilder(feedback)),
but m not geting expected data in response.

Thanks in Advance


(system) #2

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