Solr dismax query
I am trying to create a feature that allows search results to be displayed by this formu开发者_C百科la sum(weight1*text relevance score, weight2 * price)
. weight1
and weight2
are numeric values that can be changed to influence the search results.
I am sending the following query params to the Solr instance for searching.
q=red
defType=dismax
qf=10^name+2^price
My understanding is that when using dismax, Solr/Lucene looks for the search text in all the fields specified in the qf
param.
Currently my search results are similar to those I get when qf
does not including a price. I think this is because price is a numeric field and there is not text match.
Is it possible to rank search results based on this formula - sum(weight1*text relevance score, weight2 * price)
.
You were almost there! The syntax of qf is qf=field^weight
and not the other way around.
See this document for more details.
精彩评论