【发布时间】:2020-09-22 03:40:16
【问题描述】:
我正在使用 Bonsai 的免费层,并正在尝试编写一个脚本来管理我的 Elastic 索引中的文档数量。为了最大限度地提高我可以保存的文档数量,我想开始删除其中包含许多嵌套文档的文档。
例子:
{
"title": "Spiderman saves child from well",
"body": "Move over, Lassie! New York has a new hero. But is he also a menace?",
"authors": [
{
"name": "Jonah Jameson",
"title": "Sr. Editor",
},
{
"name": "Peter Parker",
"title": "Photos",
}
],
"comments": [
{
"username": "captain_usa",
"comment": "I understood that reference!",
},
{
"username": "man_of_iron",
"comment": "Congrats on being slightly more useful than a ladder.",
}
],
"photos": [
{
"url": "https://assets.dailybugle.com/12345",
"caption": "Spiderman delivering Timmy back to his mother",
}
]
}
在 Elastic 中是否有任何内容可以告诉我,由于大量嵌套,该文档实际上是 6 个文档?理想情况下,我将能够按此“文档计数”对弹性记录进行排序。
谢谢!
【问题讨论】:
-
你能解释一下你的意思是什么这个文件真的是6个文件,因为嵌套很大,你想找到什么——如果我理解正确的话,是否要查找文档中嵌套文档的数量?
标签: elasticsearch bonsai-elasticsearch