简体   繁体   中英

Solr Dismax Config for Boost Scoring

I've seen many of this topics here but still confusing to implement it. In my case i need to do these:

  1. Search certain phrases in title & text and give title^3, text^1
  2. based on result in #1, i need to boost the results by modified time

i've tried these with different results:

/solr/select
?q={!boost b=$dateboost v=$qq defType=dismax}
&dateboost=recip(ms(NOW/HOUR,modified),86400000,1,1)
&qq=video
&qf=title^3+text
&pf=title^3+text
&debugQuery=true

And Normal Query with different setting in solrconfig.xml

<str name="qf">title^3 text</str>
<str name="pf">title^3 text</str>
<str name="bf">recip(ms(NOW/HOUR,modified),86400000,1,1)</str>

I prefer to have the boost set by default in solrconfig, thanks in advanced.

Finally i used the first option, since when using.boost the dismax handler config in solrconfig.xml is being ignored.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM