# How to specify analyzers for numbers and dates

**URL:** <https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881>\
**Category:** Elasticsearch\
**Created:** [December 16, 2013, 6:53am UTC](https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881 "2013-12-16T06:53:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Amit\_Soni](https://discuss.elastic.co/u/Amit_Soni)\
**Post date:** [December 16, 2013, 6:53am UTC](https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881/1 "2013-12-16T06:53:12Z")

</div>

Hello everyone - I have been researching on what would be the best way to  
store numbers (say amount) and dates in index? My understanding is that the  
number and date fields do not really get analyzed.  
Hence one way probably to do this is use multi-field, store numbers/dates  
as string and then use right analyzers. Anything else anyone has to  
recommend?

Thanks much in advance!

-Amit.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J\_xif7kBnPzKdmg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J_xif7kBnPzKdmg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 16, 2013, 7:03am UTC](https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881/2 "2013-12-16T07:03:00Z")

</div>

What do you want to do?  
I'd say use date type for types and any type number for numbers.

I don't understand why you would have something else.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 16 déc. 2013 à 07:53, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) a écrit :

Hello everyone - I have been researching on what would be the best way to store numbers (say amount) and dates in index? My understanding is that the number and date fields do not really get analyzed.  
Hence one way probably to do this is use multi-field, store numbers/dates as string and then use right analyzers. Anything else anyone has to recommend?

Thanks much in advance!

## -Amit.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J\_xif7kBnPzKdmg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J_xif7kBnPzKdmg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5123C32F-8936-4B73-ADD9-A4494A76AE28%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5123C32F-8936-4B73-ADD9-A4494A76AE28%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Amit\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Amit\_Soni](https://discuss.elastic.co/u/Amit_Soni)\
**Post date:** [December 16, 2013, 7:12am UTC](https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881/3 "2013-12-16T07:12:48Z")

</div>

David - Thanks for the quick reply. Let me take an example:  
Lets say I am storing 500 as a numerical value. I would expect an input of  
500.0 to match what I have. How can I accomplish this?

-Amit.

On Sun, Dec 15, 2013 at 11:03 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> What do you want to do?  
> I'd say use date type for types and any type number for numbers.
> 
> I don't understand why you would have something else.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 16 déc. 2013 à 07:53, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) a écrit :
> 
> Hello everyone - I have been researching on what would be the best way to  
> store numbers (say amount) and dates in index? My understanding is that the  
> number and date fields do not really get analyzed.  
> Hence one way probably to do this is use multi-field, store numbers/dates  
> as string and then use right analyzers. Anything else anyone has to  
> recommend?
> 
> Thanks much in advance!
> 
> -Amit.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J\_xif7kBnPzKdmg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJz%2BNSeqNtNmSv3c6xX4UHO-AxtFm2J_xif7kBnPzKdmg%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/5123C32F-8936-4B73-ADD9-A4494A76AE28%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5123C32F-8936-4B73-ADD9-A4494A76AE28%40pilato.fr)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAAOGaQKMoXmLOgg3qWii3NStnhfEz%3DT%3DdGdjRPuoFjouvxCGLQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAOGaQKMoXmLOgg3qWii3NStnhfEz%3DT%3DdGdjRPuoFjouvxCGLQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:01am UTC](https://discuss.elastic.co/t/how-to-specify-analyzers-for-numbers-and-dates/14881/4 "2017-07-06T02:01:06Z")

</div>


