0

I want to index one field that contains only time in HH:mm:ss.SSS format. Which datatype I can use to store this field in elasticsearch.

mkalsi
  • 355
  • 1
  • 3
  • 14

1 Answers1

5

You can use the date mapping type with a specific date format to accomodate your data:

{
  "my_field": {
    "type": "date",
    "format": "hour_minute_second_fraction"

  }
}
Val
  • 207,596
  • 13
  • 358
  • 360
  • Could you help me on this , in "releasedate":{ "type": "date", "format": "hour_minute_second_fraction" }, I added this in my PUT request to add the mapping . To insert the data , I gave like "runtime": "1_50.30_12", . Could you suggest an approach in Kibana 7.9.2 ? Thank you. – Sameera De Silva Oct 16 '20 at 06:59
  • @SameeraDeSilva please create a new question as this one is closed – Val Oct 16 '20 at 07:05
  • thank you , added https://stackoverflow.com/questions/64384551/kibana-v-7-9-2-exact-format-for-hour-minute-second – Sameera De Silva Oct 16 '20 at 07:19