: I used the standard handler to retrieve the documents where "ghi" or "xyz" : are present (http://localhost:8983/solr/select/?q=ghi+xyz&debugQuery=1). : When the results are returned, the document with id = 50 is returned last, : since the string "ghi" is not found. I wanted to test if the score can be : altered to boost : the document with id = 50. So, I executed the following dismax query - : http://localhost:8983/solr/select/?qt=dismax&q=ghi+xyz&bf=ord(id)^2.0&debugQuery=1 : : When I did this, I didn't get any results back. I am not sure if there is : anything wrong with my syntax.
...the dismax request handler builds a DisjunctionMax query out of each of your search words across each of the "qf" fields -- you have no "qf" param (and no "qf" in the defaults listed below) so it's not building ny query for you ... if you look at the debugging info you should see that your query toString is very very empty except for the boost function. you cna add a "qf" param if you want, or if you prefer using the standard request handler syntax, you can still specify a function query as part of your query using the _val_ syntax hack... +(ghi xyz) _val_:ord(id)^2.0 : The relevant part of the solrconfig.xml file is - : <requestHandler name="dismax" class="solr.DisMaxRequestHandler"> : <lst name="defaults"> : <str name="echoParams">explicit</str> : </lst> : </requestHandler> -Hoss