How to found empty field in elasticsearch


(Mohammadhadi Sankar) #1

Hi
we have a mistake when insert data.
a field data type is text . we insert "" for data.
i cant search zero length field .
how can found like this record?


(David Pilato) #2

It would be better to reindex correctly.


(Junaid) #3

Unfortunately for text type you can't search out empty strings. You can use the exists query and fetch all the document for which that field exists and perform an empty string comparison at the application layer.

You can take a look at a similar post here.