Islandora Solr facet sort values by index

169 views
Skip to first unread message

El Santiago

unread,
Jun 17, 2015, 4:07:20 PM6/17/15
to isla...@googlegroups.com
Is it posible to sort specific solr facet fields in Islandora?
I have a facet that holds the year of creation of an object. By default, all values are sorted by 'count', I want them to show in ascending order (index?). Here is an image of what I'm getting now:




------------------------
Santiago

El Santiago

unread,
Jun 18, 2015, 12:39:04 PM6/18/15
to isla...@googlegroups.com
Nobody? Well, maybe I'm asking a dumb question?, maybe the wrong place to ask it?
I don't find any documentation about this matter. I only found this in SOLR docs about facet.sort but don't know how or were to implement it in Islandora.
Can I use this?:
f.<field_name>.facet.sort=index
Where should I define it?
------------------------
Santiago

El Santiago

unread,
Jun 18, 2015, 1:09:41 PM6/18/15
to isla...@googlegroups.com
I hardcoded a ksort to the the specific facet results in the getFacet function of the IslandoraSolrFacets class. It works fine, but it maybe a best solution?
Please help!

Diego Pino

unread,
Jun 19, 2015, 3:10:35 PM6/19/15
to isla...@googlegroups.com
Hi Santiago, right place, no dumb question at all.

There are several settings currently unavailable in the Solr Search module that could be of use(see also the TODO.txt file), but this is also an opportunity to contribute to the community by implementing some of them, or if you can't, by opening a JIRA Ticket describing this need.
Basically you would need to add a "sort type" form field in the facet field configuration(islandora_solr_admin_settings_facet_fields), make sure this setting is added (look at the defaults) and then read/used by the query.

Also, quick fix for your local use is implementing your own hook_islandora_solr_query_alter($islandora_solr_query) and adding your facet ordering (like in Solr's documentation) to $islandora_solr_query->solrParams. Ideally by making some checks of course (like if the facet field really exists, etc).

Best

Diego

Elizabeth McAulay

unread,
Jun 22, 2015, 8:54:30 PM6/22/15
to isla...@googlegroups.com
Our developers chose to do a facet sort completely in Javascript because we didn't have this config option in Islandora as it is. One day we might come back and try to add the work into Islandora, but we're under deadline so working fast was imperative.


--
For more information about using this group, please read our Listserv Guidelines: http://islandora.ca/content/welcome-islandora-listserv
---
You received this message because you are subscribed to the Google Groups "islandora" group.
To unsubscribe from this group and stop receiving emails from it, send an email to islandora+...@googlegroups.com.
Visit this group at http://groups.google.com/group/islandora.
For more options, visit https://groups.google.com/d/optout.

Phil Suda

unread,
Jun 23, 2015, 9:26:19 AM6/23/15
to isla...@googlegroups.com
Lisa,
 
   Any chance you could share the javascript code/screenshot of implementation? I am curious to see your work. 

Thank you, 

Phil 

Diego Pino

unread,
Jun 23, 2015, 3:47:43 PM6/23/15
to isla...@googlegroups.com
Hi Guys, anyone willing to make a Jira Ticket/ improvement to this one? I'm doing some local work on the solr search module and this could be a little extra coding i could assume in the next weeks.
Basicly i'm adding edismax as an option based on which Solr version is used,  allowing to use different field configurations based on which display is used (must ask the committers first before making that change!) and also allowing range facets for numbers, not only dates. This one could go into the mix.

Best

Diego

Joanna DiPasquale

unread,
Jun 24, 2015, 9:46:01 AM6/24/15
to isla...@googlegroups.com
I have been remiss about creating JIRA tickets for way too long, and this would be a great feature for the community.  So, voila!


I added the component Solr, but my guess is that it affects more than the core Islandora Solr module, so please let me know if the ticket needs editing.

I'd be willing to pitch in or at least test some code when the time comes.  Let me know!




Joanna DiPasquale
jjdipa...@gmail.com

Diego Pino

unread,
Jun 24, 2015, 11:55:25 AM6/24/15
to isla...@googlegroups.com
Great Joanna! I will take that ticket. Will let you know when i have some working code.

Cheers and thanks

Best

Diego
Reply all
Reply to author
Forward
0 new messages