Sort order for [Homepage] facets at facets.ini?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sort order for [Homepage] facets at facets.ini?

Library

Hello,

 

I would like to know if there is a setting (or, if  not, how to) set the sorting of the facets that appear at VuFind’s homepage, below the search box – it is, those under the [HomePage] section at facets.ini. I’d like them to show the results sorted by year instead of Relevance, but without changing the default setting of “Relevant” for the normal search results. Thanks in advance.

 

Best regards,

 

 

---------------------------------

Xavier Berdaguer

Information Specialist

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sort order for [Homepage] facets at facets.ini?

Demian Katz

There are only two ways to sort facet values in Solr: by string or by count. I am not sure what you mean when you say you want to sort them by year.


VuFind uses the "by count" sorting to pick the first N results, and then sorts them alphabetically using this view helper:


https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/View/Helper/Root/SortFacetList.php


Doing the sort in PHP is necessary not just to allow Solr to first pick the most common results, and also to allow translated facets to be sorted correctly in all the different languages.


If you wanted to do a count-based search rather than an alphabetical search, you could adjust either the view helper above or the template code here:


https://github.com/vufind-org/vufind/blob/master/themes/bootstrap3/templates/search/home.phtml#L72


If you want to change the sort order used by the outgoing links from the facet values, you can adjust the way the URLs are created in the SortFacetList helper.


Does that answer your question? If you still don't have what you need, please clarify what you are trying to achieve and I will be happy to offer more specific advice!


thanks,

Demian




From: Library <[hidden email]>
Sent: Friday, May 26, 2017 7:10 AM
To: [hidden email]
Subject: [VuFind-General] Sort order for [Homepage] facets at facets.ini?
 

Hello,

 

I would like to know if there is a setting (or, if  not, how to) set the sorting of the facets that appear at VuFind’s homepage, below the search box – it is, those under the [HomePage] section at facets.ini. I’d like them to show the results sorted by year instead of Relevance, but without changing the default setting of “Relevant” for the normal search results. Thanks in advance.

 

Best regards,

 

 

---------------------------------

Xavier Berdaguer

Information Specialist

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Loading...