ElasticSearch version: 6.8.2
Index metadata fragment:
{
"my_index": {
"mappings": {
"type": {
"properties": {
"my_field": {
"type": "text",
"index": false,
"store": true
},
I want to find all documents in the index, where:
- "my_field" is absent OR
- "my_field" is present, field value is null OR
- "my_field" is present, field value is an empty array
I would use "exists" query (Exists query | Elasticsearch Reference [7.10] | Elastic) for my purpose, but, as far as I understand, it only works with the indexed fields. In my case, it always returns all the documents.
How can I find all documents in this case, by the criteria defined above?