dismax solr请求处理程序MM,PS和Q.ALT

Joe*_*Joe 8 lucene solr

我正在测试dismax requesthandler,我试图自定义mm(最小匹配)参数(我已经查看了文档)

 <str name="mm">
 2<-2 3<-70% 5<-50%  
 </str>
 <int name="ps">100</int>
 <str name="q.alt">*:*</str>
Run Code Online (Sandbox Code Playgroud)

我有3个问题:

  • mm,我明白了它的作用,我想验证我的参数是否正常,

    纠正我,如果错误
    2 <-2 3 <-70%5 <-50%代表什么?:

    • 如果1或2个术语与100%相匹配
    • 如果3到4只匹配其中的70%
    • 如果5个或更多只匹配50%
  • ps:这个参数是什么?这是强制性的吗?

  • q.alt:同样我不明白那个的实用性.

你能为我提供DisMax最佳配置的建议吗?

谢谢 !

Kar*_*son 10

1:你的字符串会转换为

1-2 terms: match all terms
3 terms: total number of terms - 2 must match (i.e. 1 term must match :)
4-5 terms: 70% of the terms must match 
6+ terms: 50% of the terms must match
Run Code Online (Sandbox Code Playgroud)

mm-string将满足您的要求

2<%70 4<%50
Run Code Online (Sandbox Code Playgroud)

这里可以找到mm字符串的非常好的资源.

2:pf参数用于基于彼此非常接近的查询术语来提高文档相关性(而不是分散在整个文档中).

3:q.alt参数用作客户端未提供任何搜索条件的情况的后备查询.在我的解释中,如果您不进行任何客户端查询处理/转换,则可以使用它,但可能还有其他实际用途.