Query nullabe fields with value compare

Im trying to query for a field which can be null, the query is for all document which its field is not null and the field value is equal for a given string.
e.g: field named parent can be null or can hold string with the parent name, the query needed is all the documents with parent value (not null - exists) and equal to a given parent name.
i tried to look in different places on how to do this, and cannot find something exactly like this.


Can you past part of your query and/or you mapping to see how you write your queries ?

You do not need to add "not null" , just make a termQuery with your_field = value.

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