Elasticsearch: How to make all properties of object type as non analyzed?
<p>I need to create an Elasticsearch mapping with an Object field whose keys are not known in advance. Also, the values can be integers or strings. But I want the values to be stored as non analyzed fields if they are strings. I tried the following mapping:</p>

<pre><code>PUT /my_index/_mapping/test
{
  "properties": {
    "alert_text": {
      "type": "object",
      "index": "not_analyzed"
    }
  }
}
</code></pre>

<p>Now the index is created fine. But if I insert values like this:</p>

<pre><code>POST /my_index/test
{
  "alert_text": {
    "1": "hello moto"
  }
}
</code></pre>

<p>The value "hello moto" is stored as an analyzed field using standard analyzer. I want it to be stored as a non analyzed field. Is it possible if I don't know in advance what all keys can be present ?</p>