0

I would like to know if elasticsearch considers empty string as null value, but based on my mapping shown below, I don't see that it is doing that. How can I make elasticsearch consider empty string as a null and index using the value provided by null_value. My mapping is shown below:

{
    "mapping": {
        "my_typee": {
            "properties": {
                "autoRank": {
                    "type": "integer",
                    "null_value": 0,
                    "store": true,
                    "index": "analyzed"
                }
            }
        }
    }
}

Thanks in advance.

1 Answer 1

1

Elasticsearch does not index empty strings. In your case your field is actually not string but an integer of type. And null_value option is actually does what you want to do. You dont need to do anything extra.

https://www.elastic.co/guide/en/elasticsearch/reference/current/null-value.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.