Elasticsearch 6.8 returns date as long not string

FYI. The data is being indexed to elasticsearch from Spark dataframe.
Putting date data directly in Kibana, and querying, return date as String.

Elasticsearch 6.8/Kibana date field query always returns long value, not string.
Index mapping:

PUT sp_date_test_2020?include_type_name=true
  "settings": { 
    "number_of_shards": 1
  "mappings": {
    "_doc": { 
      "properties": { 
          "type": "date"
        "year": { "type": "integer"}

All query hits return values like:
"test_date" : 2493400000000

I would like the dates to return as string values "2010-08-09"

I have a fix. In the dateframe cast the date column to string prior to indexing.
Behaves as expected now.

Can you come up with a fully reproducible example that contains index creation, index mapping, sample documents to index and the query you executed? Otherwise helping will just be guessing instead of knowing. See https://www.elastic.co/help

Thank you!

Sorry, I am new to this discussion and do not know how to close this topic.
I have a solution.
The problem turned out to be that the column was stored as "timestamp" in the DataFrame. Casting the column to type String in dateframe prior to indexing resulted in the index display/type which I wanted.
Behaves as expected now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.