0
votes

For Example I have an Elasticsearch Index and Type Mapping as below:

PUT /index
{"mappings": {
"type": {
    "properties":{
    "title":{
    "type":"string"
    } ,
    "name":{
        "type":"string"
    },
    "warning":{
        "type":"string"
          }
       }
   }  

} } and i have one document like

Document 1: {"type":"type text","name":"name text"}

now when I query for Document 1 since I have not indexed warning field but I have created the mapping for it I need to get warning value as null. That is my response should be {" type":"type text","name":"name text","warning": null} Is this possible in Elasticsearch and or while indexing does I need the map that warning field as null or I am missing anything else. Please help. I am using Elasticsearch version 2.3.1

1

1 Answers

0
votes

Elasticsearch gives you back exactly what you indexed (in JSON format exactly your initial document), so you need to explicitly index "warning":null so that you can get back "warning":null.