I don’t have much direct experience with using field values in relevance calculations, but it can be done.  Here are some starting points, and perhaps others can offer advice backed by more experience.


You can use the DismaxParams section of searchspecs.yaml to send extra parameters to Solr’s Dismax query parser.  You can then use the Dismax “bf” (boost function) parameter to boost results using a function:




The disadvantage to using “bf” is that it only works with Solr’s Dismax handler… which VuFind uses most of the time, but not always – advanced searches (those with special operators like wildcards, or anything coming from the “Advanced Search” page) use the older Lucene-syntax handler and will ignore the bf setting.


You can use the “_val_” special field to include functions in non-DisMax queries…. though I don’t think VuFind has a simple way to support this natively.  If you need it, we might be able to figure something out, though!


A lot of the complexity of working with function queries involves figuring out the math to get your boost to have the right level of impact – you don’t want to have too much or too little effect on the results.  There is a whole chapter discussing this in more detail in this book:




There are also more details here, though in a much less reader-friendly form:




You might also be able to get some general advice on the solr-user mailing list:




Good luck!


- Demian


From: Tulie Amichal [mailto:tulie@mail.iucc.ac.il]
Sent: Tuesday, January 25, 2011 5:50 AM
To: vufind-tech@lists.sourceforge.net
Subject: [VuFind-Tech] buusing results




Were doing a unified catalog (http://aleph3.libnet.ac.il:8080/vufind) and have an attribute for a record for how many institutions have it. I would like to tweak the ranking mechanism so that results owned by multiple institutions are ranked slightly higher than those owned by one. I don’t want to completely override the relevancy ranking by search term, just give these results a little boost.


Whats the best way to do that? Searchspecs.yaml seems to be relevant only ranking within fields where a match is found.


All hints will be welcome





Tulie Amichal

Information Systems Analyst


Office: 03-6460554