I am trying to get my elasticsearh query to work, but I get this error:
org.elasticsearch.common.ParsingException: [exists] unknown token [START_ARRAY] after [field]
The query is supposed to get all documents that have dates in either date.old or date.new between the two years(1500,1550), and also include documents that have undefined values for those fields.
This is my query:
{
"query":{
"bool":{
"should":[
{
"range":{
"date.old":{
"gte":1500,
"lte":1550
}
}
},
{
"range":{
"date.new":{
"gte":1500,
"lte":1550
}
}
},
{
"bool":{
"must_not":{
"exists":{
"field":"date.new"
}
}
}
},
{
"bool":{
"must_not":{
"exists":{
"field":"date.old"
}
}
}
}
]
}
}
}
Do anyone see the problem here? Thanks!