# Date type changed to text after upgrading from elastic and kiban 6.4.1 to 7.8.0

**URL:** <https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803>\
**Category:** Kibana\
**Created:** [July 5, 2021, 9:40am UTC](https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803 "2021-07-05T09:40:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karim.zahar](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@karim.zahar](https://discuss.elastic.co/u/karim.zahar)\
**Post date:** [July 5, 2021, 9:40am UTC](https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803/1 "2021-07-05T09:40:06Z")

</div>

hello,  
I have developed a java springboot batch that collect data from middleware logs and insert it to elastic index, the index is created by the batch with some fields that have date type (datein, dateout...).  
After upgrading from ELK 6.4.1 and 7.8.0, the "date" type fields became "text" type in kibana so I can't filter these fields by date.  
How can I get back the date fields so I can filter by date in kibana, please.  
Here's the code creation of the index in java:

```auto
public void createIndexProxy(String typeLog) throws InterruptedException,
			ExecutionException, IOException {

		LOG.info("############ création de l'index: " + typeLog);

		client.admin().indices().create(new CreateIndexRequest(typeLog))
				.actionGet();
		
		CreateIndexRequest request = new CreateIndexRequest(typeLog);
        request.settings(Settings.builder()
                .loadFromSource(Strings.toString(
						jsonBuilder().prettyPrint().startObject()
						.startObject(typeLog).startObject("properties")
						.startObject("service").field("type", "keyword").field("index", "true").endObject()
						.startObject("uc").field("type", "text").endObject()
						.startObject("thread").field("type", "text").endObject()
						.startObject("adresseIp").field("type", "text").endObject()
						.startObject("dateIn").field("type", "date").field("format", "dd/MM/yyyy HH:mm:ss").endObject()
						.startObject("dateOut").field("type", "date").field("format", "dd/MM/yyyy HH:mm:ss").endObject()
						.startObject("requestTime").field("type", "integer").endObject()
						.startObject("fluxIn").field("type", "text").endObject()
						.startObject("fluxOut").field("type", "text").endObject()
						.startObject("exception").field("type", "text").endObject()
						.startObject("serviceTime").field("type", "integer").endObject()
						.startObject("serviceResponseLength").field("type", "integer").endObject()
						.startObject("timestamp").field("type", "long").endObject()
						.startObject("synchStatus").field("type", "text").field("index", "true").endObject()
						.startObject("utilisateur").field("type", "text").endObject()
						.endObject().endObject().endObject()), XContentType.JSON)
        );

        
       ActionFuture<CreateIndexResponse> actionFuture = client.admin().indices().create(request);
		
		LOG.info("############ l'index " + typeLog + " a été créé");
	}

```

thanks for your help.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [July 16, 2021, 6:18pm UTC](https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803/2 "2021-07-16T18:18:18Z")

</div>

Hi, the mapping of fields to their data types is controlled by Elasticsearch. Check the mapping of your index to see how the data will be interpreted by Kibana. See [Get mapping API | Elasticsearch Guide [7.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.8/indices-get-mapping.html)

It's most likely that your Java program needs to set a mapping for the data in index settings. See [Create Index API | Java REST Client [7.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.13/java-rest-high-create-index.html#java-rest-high-create-index-request-mappings)

---

<div class="post-metadata">

**Author:** ![karim.zahar](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@karim.zahar](https://discuss.elastic.co/u/karim.zahar)\
**Post date:** [July 19, 2021, 8:07am UTC](https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803/3 "2021-07-19T08:07:38Z")

</div>

Hi,  
thanks for your feedback  
the problem was with the date format, ES 7.8 accept this format only "yyyy/MM/dd HH:mm:ss".

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 16, 2021, 8:08am UTC](https://discuss.elastic.co/t/date-type-changed-to-text-after-upgrading-from-elastic-and-kiban-6-4-1-to-7-8-0/277803/4 "2021-08-16T08:08:16Z")

</div>

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