# Date type

**URL:** <https://discuss.elastic.co/t/date-type/113321>\
**Category:** Вопросы на русском языке\
**Created:** [December 27, 2017, 2:19pm UTC](https://discuss.elastic.co/t/date-type/113321 "2017-12-27T14:19:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavuk/32/28914_2.png) [@pavuk](https://discuss.elastic.co/u/pavuk)\
**Post date:** [December 27, 2017, 2:19pm UTC](https://discuss.elastic.co/t/date-type/113321/1 "2017-12-27T14:19:56Z")

</div>

Вопрос такой. Есть существующий индекс с таким маппингом:

```
{
  "sentiment": {
    "mappings": {
      "test-type": {
        "properties": {
          "author": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "date": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "message": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "polarity": {
            "type": "float"
          },
          "sentiment": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "subjectivity": {
            "type": "float"
          }
        }
      }
    }
  }
}

```

Проблема в том, что тут date с типом text. A хотелось бы иметь timestamp. Как можно это сделать для уже существующего индекса?  
Спасибо.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 27, 2017, 5:24pm UTC](https://discuss.elastic.co/t/date-type/113321/2 "2017-12-27T17:24:10Z")

</div>

Надо переиндексировать либо в тот же самый или в другой индекс. Если в тот-же, то можно воспользоваться [multi field](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/multi-fields.html), если в другой - то можно просто создать другой индекс с правильным маппингом.

---

<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:** [January 24, 2018, 5:24pm UTC](https://discuss.elastic.co/t/date-type/113321/3 "2018-01-24T17:24:11Z")

</div>

Closed on January 24, 2018, 5:24pm UTC

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