EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #04626


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

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


Sorry, it took me a while to figure out what was going on.

For maintainability, as always, it's a good idea to make changes in new cfg.d files rather than modify existing ones.  When you upgrade, this will make it far easier normalise your cfg directory to the new defaults.  You can achieve this by putting the following in cfg.d/z_relevance_order_default.pl:

$c->{search}->{simple}->{order_methods}->{byrelavance} = '';
$c->{search}->{simple}->{default_order} = 'byrelevance';
$c->{search}->{advanced}->{order_methods}->{byrelavance} = '';
$c->{search}->{advanced}->{default_order} = 'byrelevance';


--
Adam Field
Business Relationship Manager and Community Lead
EPrints Services
+44 (0)23 8059 8814





On 2 Sep 2015, at 04:48, Ajunk Pracetio wrote:

> Hi,
> Thank Brian...now my simple & advanced result set relevance as default.
> 
> On Wed, Sep 2, 2015 at 12:18 AM, Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca> wrote:
> I'm also using 3.3.12, and confirm the following:
> 
> 1) Relevance sort was not the default sort option on simple search, but it did show up as an option in the dropdown.  Users had to manually switch to relevance sort.  So my setting for eprints_search_simple.pl doesn't have this:
> "byrelevance"    => "",
> But I did need to add the following:
> default_order => "byrelevance",
> 2) Relevance sort was not even listed as an option on advanced search, until I changed the setting to Brian's suggestion.  Now it appears, and the default is set to relevance.
> 
> Tomasz
> 
> 
> -----Original Message-----
> From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Brian D. Gregg
> Sent: September-01-15 12:19 PM
> To: eprints-tech@ecs.soton.ac.uk
> Subject: [EP-tech] Re: Relevance ranking for Simple and Advanced Search
> 
> Adam,
> 
> Agreed, If Xapian is working then you should at least get an option to order by relevance, but I was not and it also was not set as the default sort either for simple or advanced search.  If there is something in the code that was supposed to do this then it is not doing it at least in the version I'm using 3.3.12.  This is what caused me to come up with the config changes that I posted.  Obviously Tomasz had a similar issue.
> 
> So what I would assume (in a perfect scenario) should happen is that if the Xapian search engine is found to be installed, it should:
>    a.) Add an order by relevance to both the simple and advanced search.
>    b.) Set the order by relevance as default for both the simple and advanced search as this is what users expect to find.
> 
> -Brian.
> 
> -----Original Message-----
> From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Field A.N.
> Sent: Tuesday, September 01, 2015 11:49 AM
> To: eprints-tech@ecs.soton.ac.uk
> Subject: [EP-tech] Re: Relevance ranking for Simple and Advanced Search
> 
> I'm not sure this will work.  In any case, if Xapian is working, you should get an option to order by relevance.  If Xapian isn't working, it can't possibly do you any good.
> 
> --
> Adam Field
> Business Relationship Manager and Community Lead EPrints Services
> +44 (0)23 8059 8814
> 
> 
> 
> 
> 
> On 1 Sep 2015, at 16:29, Tomasz Neugebauer wrote:
> 
> > Dear Brian,
> >
> > Thank you for this information!  I was having trouble getting the advanced search to use relevance sort, and your post solved it for me.
> > I think that relevance sort is what users expect as a default sort.
> > Should we update the simple and advanced search config examples here: http://wiki.eprints.org/w/Search.pl to use relevance sort by default?
> >
> > Tomasz
> >
> >
> > ________________________________________________
> > Tomasz Neugebauer
> > Digital Projects & Systems Development Librarian Libraries /
> > Bibliothèques Concordia University / Université Concordia
> >
> >
> >
> > From: eprints-tech-bounces@ecs.soton.ac.uk
> > [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Brian D.
> > Gregg
> > Sent: August-27-15 12:21 PM
> > To: 'eprints-tech@ecs.soton.ac.uk' <eprints-tech@ecs.soton.ac.uk>
> > Subject: [EP-tech] Relevance ranking for Simple and Advanced Search
> >
> > 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
> > Tel: (412) 648-3264 | Email: bdgregg@pitt.edu | Fax: (412) 648-3585
> >
> > *** Options:
> > http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> > *** Archive: http://www.eprints.org/tech.php/
> > *** EPrints community wiki: http://wiki.eprints.org/
> > *** EPrints developers Forum: http://forum.eprints.org/
> 
> 
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
> 
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
> 
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
> 
> 
> 
> -- 
> Life isn't valuable if you don't have someone to care
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/