I want to check for documents that have media_url == '' || media_url == null. I have a query:
{
"engagements": [
"blah"
],
"query": {
"from": 0,
"size": 2,
"sort": [
{
"bookmarked": {
"order": "desc"
}
},
{
"created_at": {
"order": "desc"
}
}
],
"facets": {},
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
{
"term": {
"car_id": "78778"
}
},
{
"range": {
"created_at": {
"gte": "2015-04-12T04:00:00.000Z",
"lte": "2015-05-13T03:59:59.999Z"
}
}
},
{
"term": {
"media_url": ""
}
}
],
"should": [
{
"term": {
"bookmarked": false
}
}
]
}
}
}
},
"aggregations": {
"word_frequencies": {
"terms": {
"field": "text",
"size": 150
}
}
},
"highlight": {
"fields": {
"text": {
"fragment_size": 1500
}
}
}
},
"api": "_search"
}
However, if I do what I do above, then records that are set to null wouldn't be returned. What should I do to return records with either '' or null as their media_url value?