I wish to index a date value into several fields each in different format.
for example, index "1/1/2011 10:11:12" into two fields:
- time: "HH:mm:ss"
- date: "dd/MM/yyyy HH:mm:ss"
I tried using both multi fields and copy_to features using the bellow schema but with no luck.
I get "Invalid format: "1/1/2011 10:11:12" is malformed at "/1/2011 10:11:12""
copy_to
{
"mappings": {
"myIndex": {
"properties": {
"time": {
"type": "date",
"format": "HH:mm:ss"
},
"date": {
"type": "date",
"format": "dd/MM/yyyy HH:mm:ss",
"copy_to": "time"
}
}
}
}
}
multi field
{
"mappings": {
"myIndex": {
"properties": {
"date": {
"type": "date",
"format": "dd/MM/yyyy HH:mm:ss",
"fields": {
"time": {
"type": "date",
"format": "HH:mm:ss"
}
}
}
}
}
}
}
Is there a way to do it - without using scripts - because i cannot afford having an impact on performance?