solrdismaxsolr-boost

How to down boost a term in dismax


All:

What I want to do is to highly score documents which have "season" in content field AND heavily punish documents with "season" in the title field AND boost the newly created documents.

I wonder how to do that in Dismax(or eDismax)? Thanks


Solution

  • Boosting on qf parameter will boost the field regardless of value in the field. In order to boost documents that contains the keyword "season" in the content field use "bq" parameter instead. For ex.

    select?q=*&bq=content:season^50&bq=title:season^0.001

    To boost newly created documents use a boost function like

    recip(ms(NOW,mydatefield),3.16e-11,1,1)

    where mydatefield is the field containing the timestamp of when the document is created or updated.

    More details on the usage of boost functions can be found here