# CreateIndexRequest with date math

**URL:** <https://discuss.elastic.co/t/createindexrequest-with-date-math/348496>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [December 3, 2023, 9:01am UTC](https://discuss.elastic.co/t/createindexrequest-with-date-math/348496 "2023-12-03T09:01:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avnere](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@avnere](https://discuss.elastic.co/u/avnere)\
**Post date:** [December 3, 2023, 9:01am UTC](https://discuss.elastic.co/t/createindexrequest-with-date-math/348496/1 "2023-12-03T09:01:40Z")

</div>

Hi

I am using RestHighLevelClient 7.13.

I am trying to create an index with date math:

```auto
CreateIndexRequest cir = new CreateIndexRequest("<books-{now/d}-0001>");

```

It create an index with the name books, without the date.

What is missing?

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [December 5, 2023, 1:52pm UTC](https://discuss.elastic.co/t/createindexrequest-with-date-math/348496/2 "2023-12-05T13:52:55Z")

</div>

This may be related to [special character escaping](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/date-math-index-names.html).

Can you try with `CreateIndexRequest("%3Cbooks-%7Bnow%2Fd%7D%3E-0001")` ?

---

<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 2, 2024, 1:53pm UTC](https://discuss.elastic.co/t/createindexrequest-with-date-math/348496/3 "2024-01-02T13:53:05Z")

</div>

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