在前端搜索操作时获取数据计数
Get count of data while search operation on front end
这是我的数据如何存储在索引中的示例对象。
{
_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在所有其他文档backlinksArray in function_score.
中存在的次数
我在 function_score 中使用 Painless 语言。
提前致谢!
据我了解,您想在前端操作期间获取反向链接数。不过我觉得还是先把计数存起来,再做相应的运算就好了。
这是我的数据如何存储在索引中的示例对象。
{
_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在所有其他文档backlinksArray in function_score.
中存在的次数我在 function_score 中使用 Painless 语言。
提前致谢!
据我了解,您想在前端操作期间获取反向链接数。不过我觉得还是先把计数存起来,再做相应的运算就好了。