elasticsearch - Kibana Discover 中的 DSL 查询不能用作 Kibana 开发工具
问题描述
以下是具有内部命中的 MappingIndex、插入值和嵌套搜索查询
** 创建弹性映射索引**
PUT employee
{
"mappings": {
"emp_db": {
"properties": {
"emp_group": {
"type": "text"
},
"company": {
"type": "nested",
"properties": {
"employee": {
"properties": {
"first": {
"type": "text",
"fielddata": true
},
"last": {
"type": "text",
"fielddata": true
}
}
}
}
}
}
}
}
}
** 在创建的弹性索引映射上插入少量值 **
PUT employee/_doc/1
{
"emp_group" : "000001",
"company": [
{
"employee": {
"first": "Alice",
"last":"Smith"
}
},
{
"employee":{
"first": "Pat",
"last":"Smith"
}
},
{
"employee":{
"first": "Alice",
"last":"Hazelwood"
}
}
]
}
** 嵌套查询内部命中(它在 Kibana 开发工具中工作,但在 Kibana Discover 中不工作)**
GET employee/_search
{
"_source":false,
"query": {
"nested": {
"path": "company",
"query": {
"bool": {
"must": [
{ "match": { "company.employee.first": "Alice" }},
{ "match": { "company.employee.last": "Smith" }}
]
}
},
"inner_hits": {
"_source": false,
"docvalue_fields": [
"company.employee.first",
"company.employee.last"
]
}
}
}
}
上面嵌套的内部命中查询完美地工作并在 Kibana Dev Tools 中给了我正确的结果,但是当我在 Kibana Discover (filter-> Edit Query DSL) 中运行相同的查询时,它没有给我任何结果。
非常感谢任何帮助..
解决方案
推荐阅读
- android - Firebase Unity Android:在您的项目中找不到 google-services.json 文件
- html - XSS 攻击,多个 html 清理
- xaml - 单击运行按钮时如何将xaml作为窗口打开
- django - 模板中的 Django 列表在嵌套 for 循环中没有尾随逗号
- python-3.x - Discord 接收音频
- python - 在张量流中从优化器向后获取依赖项列表
- html - node.js 强大的 express.js
- python-3.x - 如何检测带有特定字母的单词并将它们返回到包含它们的列表中
- google-apps-script - 将数据从 Google 表格写入 Redshift
- python - Python epoch - 日期时间转换错误?