V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
puncsky
V2EX  ›  云计算

请教 Linkedin 的开源 typeahead/autocomplete 工具 cleo 的原理

  •  
  •   puncsky · 2015-01-31 03:25:11 +08:00 · 2970 次点击
    这是一个创建于 3345 天前的主题,其中的信息可能已经有所发展或是发生改变。

    解释的连接在这里:

    https://engineering.linkedin.com/open-source/cleo-open-source-technology-behind-linkedins-typeahead-search

    我的问题是,Query Walkthrough 中第二步和第三部无法理解:既然已经从 inverted index 里面取到了id,为什么还要再filter (bloomfilter快速筛选,forward index去除false positive)一下呢?为什么不直接对所有id评分排序求结果就完了呢?

    2 条回复    2019-10-03 03:09:22 +08:00
    berzjackson
        1
    berzjackson  
       2015-01-31 22:09:05 +08:00   ❤️ 1
    第一步inverted index确保prefix在document里头
    第二步利用bloom filter概率上确保query在document里头,小概率存在false positive
    第三步forward index去除第二部的false positive

    另外,在Linkedin的他们这个场景里,score主要是基于popularity或者People You May Know的,和query relavence没有关系。按我的理解,这个设计的前三个步骤一方面是彻底解决query匹配,另一方面是过滤掉大量结果,只留少量document进入最后的评分排序逻辑,这样如果评分算法很复杂,例如引入了机器学习之类的东西,性能不会成为瓶颈
    puncsky
        2
    puncsky  
    OP
       2019-10-03 03:09:22 +08:00
    @berzjackson 感激,原来主要原因是有 prefix 不一定有 term,要“确保 query 在 document 里头”
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5276 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:18 · PVG 17:18 · LAX 02:18 · JFK 05:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.