[EP-tech] Relevance ranking for Simple and Advanced Search

Brian D. Gregg bdgregg at pitt.edu
Thu Aug 27 17:20:55 BST 2015


All,

Just passing this along in case anyone has been looking at searching (simple and advanced) and wondering about how to make relevance ranking results the default for at least the 3.3.12 (version we are running) of Eprints.  As usual... your millage may vary.

In our Eprints 3.3.12 instance we changed the following files and ran 'epadmin reload {archive}' to make the changes stick.

cfg/cfg.d/eprints_search_simple.pl:

        preamble_phrase => "cgi/search:preamble",
        title_phrase => "cgi/search:simple_search",
        citation => "result",
        page_size => 20,
        order_methods => {
                "byrelevance"    => "",
                "byyear"         => "-date/creators_name/title",
                "byyearoldest"   => "date/creators_name/title",
                "byname"         => "creators_name/-date/title",
                "bytitle"        => "title/creators_name/-date"
        },
        #default_order => "byyear",
        default_order => "byrelevance",
        show_zero_results => 1,

cfg/cfg.d/eprints_search_advanced.pl:

        preamble_phrase => "cgi/advsearch:preamble",
        title_phrase => "cgi/advsearch:adv_search",
        citation => "result",
        page_size => 20,
        order_methods => {
                "byrelevance"    => "",
                "byyear"         => "-date/creators_name/title",
                "byyearoldest"   => "date/creators_name/title",
                "byname"         => "creators_name/-date/title",
                "bytitle"        => "title/creators_name/-date",
                "byid"           => "eprintid",
        },
        #default_order => "byyear",
        default_order => "byrelevance",
        show_zero_results => 1,

By adding the "byrelevance" line to the order_methods and setting the default_order to "byrelevance" we now have relevance ranking search results for both our simple and advanced searches by default.

Hope this helps,
Thanks,
Brian.

Brian D. Gregg
Solutions Architect | Manager Systems Development
University of Pittsburgh | University Library System
Address: 7500 Thomas Blvd.  Room 129 Pittsburgh, PA 15208<https://maps.google.com/maps?q=7500+Thomas+Blvd,+Pittsburgh,+PA&hl=en&sll=41.117935,-77.604698&sspn=7.662465,13.73291&oq=7500+Tho&t=h&hnear=7500+Thomas+Blvd,+Pittsburgh,+Pennsylvania+15208&z=17>
Tel: (412) 648-3264 | Email: bdgregg at pitt.edu<mailto:bdgregg at pitt.edu> | Fax: (412) 648-3585

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150827/97a8bdfa/attachment.html 


More information about the Eprints-tech mailing list