Template to store everything in string

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?

{
"element":{
"name" : "one"
"code" : 1232
"location" : {"lon" : 12,2121, "lat" : 4,5656}
}
"data_in_string":{
"something" : "in_string",
"everything" : "in_string",
"number" : "12"
}
}

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:

curl -XPUT localhost:9200/twitter/tweet/_mapping -d '{
"tweet" : {
"numeric_detection" : true,
"properties" : {
"message" : {"type" : "string"}
}
}
}
'

On Sunday, April 15, 2012 1:59:34 AM UTC-4, grab wrote:

Hi again,

I try to add numeric_detection to false but i don't understand where
to
PUT
it :

{
"tweet" : {
"numeric_detection" : true,
"properties" : {
"message" : {"type" : "string"}
}
}
}

find it here :

Elasticsearch Platform — Find real-time answers at scale | Elastic

Somebody can tell me if it can solve my issue?

--
View this message in context:

http://elasticsearch-users.115913.n3.nabble.com/template-to-store-everything-in-string-tp3902932p3911445.html

Sent from the Elasticsearch Users mailing list archive at Nabble.com.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/template-to-store-everything-in-string-tp3902932p3913610.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.