ES field store yes no 区别——可以设置为false,如果_source有的话

简介:

store

By default, field values are indexed to make them searchable, but they are not stored. This means that the field can be queried, but the original field value cannot be retrieved.

Usually this doesn’t matter. The field value is already part of the _source field, which is stored by default. If you only want to retrieve the value of a single field or of a few fields, instead of the whole_source, then this can be achieved with source filtering.

In certain situations it can make sense to store a field. For instance, if you have a document with atitle, a date, and a very large content field, you may want to retrieve just the title and the datewithout having to extract those fields from a large _source field:

PUT my_index
{
  "mappings": { "my_type": { "properties": { "title": { "type": "text", "store": true  }, "date": { "type": "date", "store": true  }, "content": { "type": "text" } } } } } PUT my_index/my_type/1 { "title": "Some short title", "date": "2015-01-01", "content": "A very long content field..." } GET my_index/_search { "stored_fields": [ "title", "date" ]  }

 

The title and date fields are stored.

This request will retrieve the values of the title and date fields.

 

来自:https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html












本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6428653.html,如需转载请自行联系原作者


相关文章
|
5月前
|
小程序
小程序踩坑:Setting data field "xxxx" to undefined is invalid.
小程序踩坑:Setting data field "xxxx" to undefined is invalid.
86 0
|
3月前
|
JavaScript
Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory
Vue报错 Invalid default value for prop “list“: Props with type Object/Array must use a factory
67 0
|
6天前
|
JavaScript 前端开发
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
10 1
|
4月前
|
JavaScript API
Property ‘proxy‘ does not exist on type ‘ComponentInternalInstance | null‘.ts
Property ‘proxy‘ does not exist on type ‘ComponentInternalInstance | null‘.ts
|
4月前
|
JavaScript 前端开发 索引
TS - interface和type的区别
TS - interface和type的区别
22 0
|
5月前
|
JSON 小程序 API
小程序踩坑-Setting data field "list" to undefined is invalid.
小程序踩坑-Setting data field "list" to undefined is invalid.
128 0
|
8月前
|
JavaScript
vue 渲染列表报错Avoid using non-primitive value as key, use string/number value instead. found in
vue 渲染列表报错Avoid using non-primitive value as key, use string/number value instead. found in
40 0
|
10月前
|
存储 JavaScript
【ES6】Set 对象
【ES6】Set 对象
63 0
|
前端开发 JavaScript
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
1187 0
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
JSON 数据格式 索引
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题
今天有同学问到doc['field'].value与params._source['field']用法的区别,起因在于下述的一道题的解法上,下面详细讲述下我的看法
158 0
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题