Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping: Allow to enable automatic numeric types detection new fields with a string value #1233

Closed
kimchy opened this issue Aug 11, 2011 · 2 comments

Comments

@kimchy
Copy link
Member

kimchy commented Aug 11, 2011

Json has native types for numeric values. Sometimes though, numeric values are provided within a string field. Allow to configure on the root level type mapping automatic numeric detection:

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

Naturally, this can be set across all types by settings it on the _default type for an index, using it in index templates, and so on.

@kimchy kimchy closed this as completed in bf51a4e Aug 11, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
@nellicus
Copy link
Contributor

@kimchy amazingly I've discovered this just now....

is there a case for enabling this by default?

AFAIK when we send

{"field":"1.0"} 

to Elasticsearch , we want to map that as a float 95% of the cases, not as a string

I'm raising this in the context of logstash-plugins/logstash-patterns-core#173

@kimchy
Copy link
Member Author

kimchy commented Sep 22, 2016

@nellicus the reason that it is not enabled by default is that it might by mistake identify a field as a number when it is a string, and then other messages will fail to index.

jev001 pushed a commit to jev001/elasticsearch that referenced this issue Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants