这是示例对象,如何将我的数据存储在索引中。

{
_index: "crawled_websites",
_type: "crawled_websites",
_id: "1I4ZGGUBSEHPBwjchC_2",
_score: null,
_source: {
url: "https://ewn.co.za/Topic/Patricia-de-Lille",
description: "EWN - South African news: access breaking news alerts, sport, business, entertainment, opinion, multimedia and cartoons. Eyewitness News – INSIDE THE TRUTH",
updated_on: "2018-08-08 11:23:56",
keywords: "",
title: "Patricia de lille",
added_on: "2018-08-08 11:23:56",
backlinksArray: [
"https://ewn.co.za/Topic/Premier-Soccer-League",
"https://ewn.co.za/Topic/English-Premier-League",
"https://ewn.co.za/Topic/Absa-Premiership",
"https://ewn.co.za/Topic/Crusaders"
]
},
sort: [
1533727436000
]
}

现在我想要的是获取当前文档的URL在function_score中所有其他文档backlinksArray中存在的次数。

我在function_score中使用无痛语言。

提前致谢!

最佳答案

据我了解,您希望在前端操作期间获得反向链接计数。但是,我认为最好预先存储计数并进行相应的操作。

关于elasticsearch - 在前端进行搜索操作时获取数据计数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51820048/

10-11 09:02