spuder
spuder

Reputation: 18477

Elasticsearch use doc_values at field creation time

According to the elastic documentation, you can use doc_values by adding them to your mapping.

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

It appears that doc_values can be added automatically when the field is created.

Setting doc_values to true at field creation time is all that is required to use disk-based fielddata instead of in-memory fielddata.

http://www.elastic.co/guide/en/elasticsearch/guide/current/doc-values.html

How do you set this value by default?

Related SO question

Upvotes: 0

Views: 622

Answers (1)

Andrei Stefan
Andrei Stefan

Reputation: 52368

This will be the standard in 2.0 (enabled by default): https://github.com/elastic/elasticsearch/issues/8312

In the meantime, I can only think of using a dynamic mapping for any new fields to have "doc_values": true, otherwise (for any static mapping) you need to do this manually for every field where you want doc_values enabled.

Upvotes: 1

Related Questions