marbouz4
marbouz4

Reputation: 1

Solr Query: How to use date boost inside a query for the Standard Query Parser?

So far I have seen examples with date boost used mainly in queries for Dismax Query Parser. So, for example, if I have q=title:superman subject:superman, how would I add "{!boost b=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)}" to it?

Upvotes: 0

Views: 203

Answers (1)

arun
arun

Reputation: 11023

Use

q={!boost b="recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)"}(title:superman subject:superman)

If you want to multiply that boost by 100, then you can do:

q={!boost b="product(100,recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1))"}(title:superman subject:superman)

Refer to Solr function query wiki for more functions and examples.

Upvotes: 1

Related Questions