Mapping
程序员文章站
2022-03-08 16:13:22
...
Mapping
store
应用场景:
- 一个很长的字符串在source内,查询的时候不想通过_source filter从一个很大的_source中获取
- 当Mapping使用copy_to把内容copy到目标字段的时候,想显示目标字段(这时目标字段在_source内不存在)
"store": true 表示该字段存储在fields内. "store": false 表示不存储。 比如:
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"title": {
"type": "text",
"store": true
},
"date": {
"type": "date",
"store": true
},
"content": {
"type": "text"
}
}
}
}
}
PUT my_index/_doc/1
{
"title": "Some short title",
"date": "2015-01-01",
"content": "A very long content field..."
}
则在fields内只存储date和title字段,默认store=false:
{
"_index": "my_index",
"_type": "_doc",
"_id": "1",
"_version": 2,
"_score": null,
"_source": {
"title": "Some short title",
"date": "2018-10-01",
"content": "A very long content field..."
},
"fields": {
"date": [
"2018-10-01T00:00:00.000Z",
],
"title": [
"Some short title"
]
},
"sort": [
1538352000000
]
}
上一篇: SpringMVC项目报错:Ambiguous mapping found.
下一篇: Mybatis Ambiguous collection type for property ‘xxx‘. You must specify ‘java Type‘ or ‘resultMap‘.
推荐阅读
-
ElasticStack学习(七):ElasticSearch之Mapping初探
-
Mybatis映射赋值失败;异常:TypeException: Could not set parameters for mapping
-
详解 hibernate mapping配置
-
【Flask】报错解决方法:AssertionError: View function mapping is overwriting an existing endpoint function: main.user
-
Hibernate 中的 idclass mapping 问题
-
ES 11 - 配置Elasticsearch的映射(mapping)
-
mybatis-generator自动生成dao、mapping、bean配置操作
-
HibernateTools实现pojo类 数据库schma mapping映射的相互转换
-
servlet url mapping规则
-
Glide java.io.IOException(File unsuitable for memory mapping)