From: Demian K. <dem...@vi...> - 2010-10-20 11:37:05
|
If you're only concerned about making this work with DisMax, you may be able to achieve the same effect more easily using the bq and/or bf parameters: http://wiki.apache.org/solr/DisMaxQParserPlugin#bq_.28Boost_Query.29 We could probably come up with a configurable mechanism to apply boost logic to standard searches via the configuration file as well -- fortunately, I think the Solr query generation is pretty well centralized, so it's not like we'll have to refactor a ton of code. I haven't done a lot of work with function queries, so I'm not exactly sure how strictly they worry about data type... but given that publishDate is currently storing only the year, perhaps you would be better off with an integer field rather than a date field. It probably wouldn't be too hard to add a <copyField> and do a reindex on a small data set to test the theory. If that still doesn't work, let me know and I'll try to do a little more research. - Demian ________________________________________ From: Osullivan L. [L.O...@sw...] Sent: Wednesday, October 20, 2010 6:08 AM To: vuf...@li... Cc: Brown A.T.; Johnson J.P. Subject: [VuFind-Tech] Boosting Results on Publication Date Hi Folks, I’ve been asked to look into boosting more recently published items to the top of our results list and was wondering if anyone else has done something similar. According to http://wiki.apache.org/solr/SolrRelevancyFAQ , you can use something like: http://localhost:8983/solr/select?q={!boost b=$dateboost v=$qq}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qq=ipod or for dismax: http://localhost:8983/solr/select?q={!boost b=$dateboost v=$qq defType=dismax}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qf=text&pf=text&qq=ipod I have tried to get this to work on our test install but it doesn’t seem to work – I assume because the publishDate field is stored as a string. Perhaps we could create a copy of this field and store it in a date format and use that for boosting? The documentation also suggests that “now the main "q" argument as well as the "dateboost" argument may be specified as defaults in a search handler in solrconfig.xml, and clients would only need to pass "qq", the user query.” I take this to mean that this would require a code rewrite so that the search query passed from VuFind was defined as qq rather than q? Kind Regards, Luke O'Sullivan Library Systems Officer - Virtual Academic Library South West Wales Higher Education Partnership (SWWHEP) Tel: 01792 602772 Website: www.swwhep.ac.uk<http://www.swwhep.ac.uk/> Ffôn: 01792 602772 Gwefan: www.swwhep.ac.uk<http://www.swwhep.ac.uk/> Check out the new SWWHEP Online GreenGuide at: www.swwhep.ac.uk/en/projects/sustainability<blocked::http://www.swwhep.ac.uk/en/projects/sustainability> |