“docs_value” is not enabled?

After I enabled "doc_values":true, I do not see it in the response of GET.

DELETE /music
PUT /music
PUT /music/_mapping/song
{
"properties" : {
"tag": {
"type": "string",
"index" : "not_analyzed",
"doc_values": true
}
}
}
GET /music/_mapping
{
"music": {
"mappings": {
"song": {
"properties": {
"tag": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}

I was expecting to see the doc_values true to be set in the response. Am I missing something here.

Hi Sundar,

the information that you want to use doc values for this field is still there. It is just that you have to use the get field mapping API for that:

GET /music/_mapping/song/field/tag?include_defaults=true
{
   "music": {
      "mappings": {
         "song": {
            "tag": {
               "full_name": "tag",
               "mapping": {
                  "tag": {
                     "type": "string",
                     "boost": 1,
                     "index": "not_analyzed",
                     "store": false,
                     "doc_values": true,
                     "term_vector": "no",
                     "norms": {
                        "enabled": false
                     },
                     "index_options": "docs",
                     "analyzer": "_keyword",
                     "search_analyzer": "_keyword",
                     "similarity": "default",
                     "fielddata": {},
                     "null_value": null,
                     "include_in_all": false,
                     "position_increment_gap": -1,
                     "search_quote_analyzer": "_keyword",
                     "ignore_above": -1
                  }
               }
            }
         }
      }
   }
}

There you can see that doc_values is true.

Daniel

2 Likes

Thanks for the clarification.