• 请不要在回答技术问题时复制粘贴 AI 生成的内容
awebird
V2EX  ›  程序员

Solr 多字段匹配,需求不同字段优先顺序不同。可以实现么?

  •  
  •   awebird · Sep 4, 2014 · 4896 views
    This topic created in 4282 days ago, the information mentioned may be changed or developed.
    比如最简单的博客模型,只有文章标题title,和文章内容content加入solr

    以“test”作为搜索词,已知title包含'test'的有10个,content包含‘test’的有50个

    需要搜索结果,title包含的10个排在前面返回,不管同一条content中包含多少个'test'

    分别title, content匹配的可以再分别按时间排序

    可以实现么?请提供技术hint, thx
    3 replies    2016-05-16 08:24:50 +08:00
    yuankui
        1
    yuankui  
       Sep 4, 2014
    没用过solr
    把title的权重设到无限大?
    fight123
        3
    fight123  
       May 16, 2016
    你好,我也遇到相同的问题,请问如何解决的啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1089 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:05 · PVG 07:05 · LAX 16:05 · JFK 19:05
    ♥ Do have faith in what you're doing.