- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在像这样的简单 Elasticsearch 映射中:
{
"personal_document": {
"analyzer": "standard",
"_timestamp": {
"enabled": true
},
"properties": {
"description": {
"type": "multi_field",
"fields": {
"sort": {
"type": "string",
"index": "not_analyzed"
},
"description": {
"type": "string",
"include_in_root": true
}
}
},
"my_nested": {
"type": "nested",
"include_in_root": true,
"properties": {
"description": {
"type": "string"
}
}
}
}
}
}
.... "include_in_root": true
不是应该将字段 my_nested.description 添加到根文档吗?
And during a query am I not supposed to see THAT field into the
_source
field?
和
Specifying an
highlight
directive on the field 'my_nested.description' would automatically retrieve the _included_in_root value_ instead of the nested field?
(像这样) “强调”: { “领域”:{ “描述”: {}, “my_nested.description”:{} }
还是我对official nested type
documentation有什么误解? ?(这个不是很清楚)
最佳答案
如果在嵌套文档上启用了 include_in_parent 或 include_in_root 选项,那么 Elasticsearch 会在内部使用父文档上展平的嵌套字段对数据进行索引。然而,这只是 Elasticsearch 内部的,您永远不会在 _source 字段中看到它们。
If the user field is of type object, this document would be indexed internally something like this...
因为它被引用 here .
因此,您通过引用嵌套文档的字段继续执行操作(如您提到的突出显示)。您引用的突出显示语法应该如下所示
"highlight": {
"fields": {
"my_nested.description": {}
}
}
而不是
"highlight": {
"fields": {
"description": {}
}
}
关于json - Elasticsearch 的 "include_in_parent"/"include_in_root"是如何工作的?它应该显示在 '_source' 中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28274981/
在像这样的简单 Elasticsearch 映射中: { "personal_document": { "analyzer": "standard", "_ti
我是一名优秀的程序员,十分优秀!