可以“显着”聚合与多场一起使用?
在应用Shaningles filter/Analyzer的“多场”(name.shingles
)上:
"aggregations": {
"significant_words": {
"sampler": {
"shard_size": 100
},
"aggs": {
"keywords": {
"significant_text": {
"field": "name.shingles"
}
}
}
}
}
我得到空的存储桶:
"aggregations" : {
"significant_words" : {
"doc_count" : 5,
"keywords" : {
"doc_count" : 5,
"bg_count" : 153313,
"buckets" : [ ]
}
}
}
多场定义:
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword"
},
"shingles" : {
"type" : "text",
"analyzer" : "shingle_analyzer",
"fielddata" : true
}
}
I can't find any info in official documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significanttext-aggregation.html
The issue is that I try to aggregate significant terms on a "multi-field" (name.shingles
) that has applied shingles filter/analyzer:
"aggregations": {
"significant_words": {
"sampler": {
"shard_size": 100
},
"aggs": {
"keywords": {
"significant_text": {
"field": "name.shingles"
}
}
}
}
}
I'm getting empty buckets:
"aggregations" : {
"significant_words" : {
"doc_count" : 5,
"keywords" : {
"doc_count" : 5,
"bg_count" : 153313,
"buckets" : [ ]
}
}
}
Multi-field definition:
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword"
},
"shingles" : {
"type" : "text",
"analyzer" : "shingle_analyzer",
"fielddata" : true
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也可以在多场中使用重要的术语或重要的文本聚合。
但是您需要了解此聚合的工作原理,您可以检查文档,以下是其中提到的。
另外,在查看汇总结果
“ doc_count”之后,您似乎在索引中的文档数量较少:5
。您可以索引大型文档集,然后可以尝试此汇总。如果您想在木板字段上应用聚合,则也可以使用术语聚合:
You can use Significant Terms or Significant Text aggregation with multi-field as well.
But you need to understand how this aggregation work, You can check the documentation and below is what mentioned in it.
Also, It seems like you have very less number of document in index after looking your aggregation result
"doc_count" : 5
. You can index large document set and then you can try it out this aggregation.If you want to apply aggregation on shingle field then you can used terms aggregation as well: