I have lots of data which don't have type all thing are string, when i store those data if the first one is a long then another one a string i have a NumberFormatException :
"numeric_detection" is false by default. So, you don't need to set it to
false. In order to set it to true, you can "PUT" it into
/index_name/type_name/_mapping like this:
By the way, "numeric_detection" doesn't store everything in a string. It
works other way around - it tries to check if a string field contains
something that looks like a number and if it does, it maps this field to a
number.
On Sunday, April 15, 2012 10:40:58 AM UTC-4, Igor Motov wrote:
"numeric_detection" is false by default. So, you don't need to set it to
false. In order to set it to true, you can "PUT" it into
/index_name/type_name/_mapping like this:
For "element" i want to keep a clean mapping to make sort on number and geo position with location but all thing inside data_in_string must be typed "string".
cause i can have "data_in_string.number" : "13 umbrellas"
I try the dynamic template but it don't solve my numeric format exception.
By the way, "numeric_detection" doesn't store everything in a string. It
works other way around - it tries to check if a string field contains
something that looks like a number and if it does, it maps this field to a
number.
On Sunday, April 15, 2012 10:40:58 AM UTC-4, Igor Motov wrote:
"numeric_detection" is false by default. So, you don't need to set it to
false. In order to set it to true, you can "PUT" it into
/index_name/type_name/_mapping like this:
In your example, data_in_string.number will be stored as a string unless
you set "numeric_detection" to true. One thing to keep in mind is that once
elasticsearch assigns a type to a field this type cannot be changed.
On Monday, April 16, 2012 1:51:28 AM UTC-4, grab wrote:
Hi,
Thanks for the tips.
So there's no solution to store a "match" thing ("data_in_string" exemple
above) in string?
For "element" i want to keep a clean mapping to make sort on number and geo
position with location but all thing inside data_in_string must be typed
"string".
cause i can have "data_in_string.number" : "13 umbrellas"
I try the dynamic template but it don't solve my numeric format exception.
Igor Motov-3 wrote
By the way, "numeric_detection" doesn't store everything in a string. It
works other way around - it tries to check if a string field contains
something that looks like a number and if it does, it maps this field to
a
number.
On Sunday, April 15, 2012 10:40:58 AM UTC-4, Igor Motov wrote:
"numeric_detection" is false by default. So, you don't need to set it
to
false. In order to set it to true, you can "PUT" it into
/index_name/type_name/_mapping like this:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.