# Failed to make a string raw for date

**URL:** <https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099>\
**Category:** Elasticsearch\
**Created:** [January 19, 2017, 12:00am UTC](https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099 "2017-01-19T00:00:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlbrlx](https://avatars.discourse-cdn.com/v4/letter/x/7ab992/32.png) [@xlbrlx](https://discuss.elastic.co/u/xlbrlx)\
**Post date:** [January 19, 2017, 12:00am UTC](https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099/1 "2017-01-19T00:00:43Z")

</div>

Hi  
I want to search a date field without using range. So I decided to make a string raw to search into it as it is text:

```
 "myDate": {
                            "type": "date",
                            "format": " yyyy-MM-dd || yyyy-MM || Y ||date_hour_minute_second",
                            "fields": {
                                "raw": {
                                    "type": "string",
                                    "index": "not_analyzed",
                                    "null_value": "",
                                    "doc_values": true
                                }
                            }
                        }

```

But it shows up in kibana nothing for myDate.raw. Any idea?

Thanks

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [January 19, 2017, 3:06pm UTC](https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099/2 "2017-01-19T15:06:57Z")

</div>

When you say that nothing shows up in Kibana for myDate.raw are you looking at the Discover tab?

If so, I think that's normal. In an index of mine I have both `extension` and `extension.raw`. You can see them in the `Management > Index Patterns` screen when I select that index pattern and filter on `extension`;

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/f1fc9e1ff00e61032bf088207991be9c415f962c.png)

And then in Discover, I don't see `extension.raw` by default, but if I click the settings gear, and then uncheck `Hide Missing Fields`, I see it. But when I add it to the doc view it doesn't show any values.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/cf2309daf924d47878b18fd49bbbac5dd9dc498e.png)

But in Visualize, it's the other way around. I can't do an aggregation on `extension` but I can on `extension.raw` (see the first screenshot where it shows which of them is aggregatable).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/ca951fa803a80f56e05f2d910fd694f56c31d475.png)

---

<div class="post-metadata">

**Author:** ![xlbrlx](https://avatars.discourse-cdn.com/v4/letter/x/7ab992/32.png) [@xlbrlx](https://discuss.elastic.co/u/xlbrlx)\
**Post date:** [January 20, 2017, 12:41am UTC](https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099/3 "2017-01-20T00:41:35Z")

</div>

LeeDr,

Thanks for your reply. You are right about this. I do some other investigation and realized when they both are string it works and I can search thru the .raw. But when one is date and the other is string, there is no result.

---

<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:** [February 17, 2017, 12:41am UTC](https://discuss.elastic.co/t/failed-to-make-a-string-raw-for-date/72099/4 "2017-02-17T00:41:34Z")

</div>

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