Hi Amit, Thanks very much for your reply. What you said makes things a bit clearer but I am still a bit confused.
On Thu, 2009-03-12 at 23:14 -0700, dabboo wrote: > If you want to boost the records with their field value then you must use q > query parameter instead of q.alt. 'q' parameter actually uses qf parameters > from solrConfig for field boosting. >From the documentation for Dismax queries, I thought that "q" is simply a keyword parameter: >From http://wiki.apache.org/solr/DisMaxRequestHandler: q The guts of the search defining the main "query". This is designed to be support raw input strings provided by users with no special escaping. '+' and '-' characters are treated as "mandatory" and "prohibited" modifiers for the subsequent terms. Text wrapped in balanced quote characters '"' are treated as phrases, any query containing an odd number of quote characters is evaluated as if there were no quote characters at all. Wildcards in this "q" parameter are not supported. And I thought 'qf' is a list of fields and boost scores: >From http://wiki.apache.org/solr/DisMaxRequestHandler: qf (Query Fields) List of fields and the "boosts" to associate with each of them when building DisjunctionMaxQueries from the user's query. The format supported is fieldOne^2.3 fieldTwo fieldThree^0.4, which indicates that fieldOne has a boost of 2.3, fieldTwo has the default boost, and fieldThree has a boost of 0.4 ... this indicates that matches in fieldOne are much more significant than matches in fieldTwo, which are more significant than matches in fieldThree. But if I want to, say, search for films with 'indiana' in the title, with media=DVD scoring higher than media=BLU-RAY then do I need to do something like: solr/select?q=indiana And in my config: <str name="qf">media^2</str> But I don't see where the actual *contents* of the media field would determine the boost. Sorry if I have misunderstood what you mean. Cheers, Pete > Pete Smith-3 wrote: > > > > Hi, > > > > I have managed to build an index in Solr which I can search on keyword, > > produce facets, query facets etc. This is all working great. I have > > implemented my search using a dismax query so it searches predetermined > > fields. > > > > However, my results are coming back sorted by score which appears to be > > calculated by keyword relevancy only. I would like to adjust the score > > where fields have pre-determined values. I think I can do this with > > boost query and boost functions but the documentation here: > > > > http://wiki.apache.org/solr/DisMaxRequestHandler#head-6862070cf279d9a09bdab971309135c7aea22fb3 > > > > Is not particularly helpful. I tried adding adding a bq argument to my > > search: > > > > &bq=media:DVD^2 > > > > (yes, this is an index of films!) but I find when I start adding more > > and more: > > > > &bq=media:DVD^2&bq=media:BLU-RAY^1.5 > > > > I find the negative results - e.g. films that are DVD but are not > > BLU-RAY get negatively affected in their score. In the end it all seems > > to even out and my score is as it was before i started boosting. > > > > I must be doing this wrong and I wonder whether "boost function" comes > > in somewhere. Any ideas on how to correctly use boost? > > > > Cheers, > > Pete > > > > -- > > Pete Smith > > Developer > > > > No.9 | 6 Portal Way | London | W3 6RU | > > T: +44 (0)20 8896 8070 | F: +44 (0)20 8896 8111 > > > > LOVEFiLM.com > > > > > -- Pete Smith Developer No.9 | 6 Portal Way | London | W3 6RU | T: +44 (0)20 8896 8070 | F: +44 (0)20 8896 8111 LOVEFiLM.com