Store true not helping?


(Ashwin Amit) #1

With dynamic template mapping I try to set store: true to be able to disable _source field but doesn't seem to help.

My one template:

{
"template": "mytype*",
"settings": {
    "number_of_shards": 3
},
"mappings": {
    "mytype": {
        "_source": { "enabled":  false },
        "dynamic_templates": [
            {
                "default": {
                    "match": "*",
                    "match_mapping_type": "string",
                    "mapping": {
                        "type": "string",
                        "index": "not_analyzed",
                        "doc_values": true,
                        "store": true
                    }
                }
            }
        ]
    }
}

}

Output of search http://localhost:9200/mytype-2015.11.18/_mapping?pretty

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 3,
    "successful" : 3,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "mytype-2015.11.18",
      "_type" : "mytype",
      "_id" : "AVEaHFEMPCABS4o_WJOa",
      "_score" : 1.0
    } ]
  }
}

(David Pilato) #2

Sorry but this is not the result of _mapping API.


(Ashwin Amit) #3

You're right of course, sorry that is the result of _search. What I'm surprised is my extra fields don't show up here.


(system) #4