Given I have a index mapping as following
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"date": {
"type": "date",
"format": "yyyy-MM-dd||yyyy||yyyy-MM"
}
}
}
}
}
this means I can put documents in all of the allowed date types if I make sure that all documents support the date format yyyy-MM-dd I would like to use the match query to allow me to search across different types such as providing documents that have the field date as follows doc1 - date: 2016-1-1 doc2 - date: 2017-1-4 doc3 - date: 2016-2-1
I want to be able to use the match to provide a query with only 2016 and get back doc2 and doc3 back and I would also like to be able to search using 2016-1 currently elasticsearch does not care and throws no exception as it should use all date types