V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
melonux
V2EX  ›  问与答

[ES] 请问如何配置分析器来做人名搜索

  •  
  •   melonux · Jun 14, 2019 · 1803 views
    This topic created in 2512 days ago, the information mentioned may be changed or developed.

    需求:

    • 我有一批中国人名, 少数外国人名, 要把他们放在 ES 中建好索引
    • 有一个 web 页面, 允许用户输入文本来搜索人名
    • 要支持拼音搜索, 部分匹配搜索
    • 如果有多个命中, 要有比较自然的相关性排序, 命中的位置有高亮

    我感觉这个需求应该有不少人都遇到过. 想请教有没有推荐的分析器配置方式.

    我作为 ES 新手, 在尝试用 pinyin filter, edge ngram filter. 但结果总是命中得太多, 而且相关性排序很乱.

    先谢谢啦.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2746 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 13:11 · PVG 21:11 · LAX 06:11 · JFK 09:11
    ♥ Do have faith in what you're doing.