Not from the Solr side of things.... those are the only two ways available for facet sorting directly from Solr. Blacklight, of course, _could_ request all facet values and sort them client-side other ways (but I don't think it does anything like that currently).
Erik
--
You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
To post to this group, send email to blacklight-...@googlegroups.com.
To unsubscribe from this group, send email to blacklight-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/blacklight-development?hl=en.
I'm not deep into the Blacklight Way of doing things at the moment, so I'm not sure exactly what it'd take. I imagine some of committers could provide some tips.
Erik
It may not be very elegant, but I've done some custom sorting in a
helper that gets called by a view. For example, in
app/helpers/application_helper.rb:
def facet_sort!(items=[])
items.sort! { |a,b| a.value.downcase <=> b.value.downcase }
items
end
and in app/views/catalog/facet.html.erb:
<% items = facet_sort!(params[:id], @pagination.items) %>
<% items.each do |item| %>
whatever, whatever
<% end>
We did this because I couldn't figure out how to get solr to sort in a
case-insensitive way, and we wanted eBooks to sort with the other
items that start with "E."
Molly
I have done this in my local app, for a facet that only had about 25
values, I fetch em all and sort em differently myself client side before
displaying them. This isn't built into Blacklight, I custom implemented
it in my local app. That exact approach is obviously only feasible if
the number of values is small enough that you're fine displaying them
all. (Otherwise, even if you fetch em all -- what do you do with the
ones you don't display? Do you have to implement some kind of custom
paging too? I guess, if you want to show them).
Another approach, if you have too many facet values to want to fetch em
all at once, but are fine only displaying a handful of them (and not
bothering with paging over the rest), you could use Solr facet.query
feature to only ask for the values you want, and then again put them in
the order you want on display. If you did want to page the rest, still
not sure exactly how you'd do that.
Any of these approaches will require some familiar wtih Solr, with
Rails, and with Blacklight code, they aren't "beginner" level
customizations.
Jonathan
JV
Sent from my iPhone
We have about a dozen location value values, which includes our five
main libraries and some sub-locations of those main libraries, all just
together in a flat list. But on the first page, before a search has
been done when you're just looking at the facet values over the entire
corpus, we wanted the five main libraries to show up as the values, even
though some of the sub-locations of the large libraries have more
holdings than the main value for one of the smaller main libraries.
I don't think there's a good way to deep-link to it, but if you go to
http://demo.projectblacklight.org/
- expand topic
- click "more >>"
You should see the facet browser in a lightbox.
You can also access it directly at
http://demo.projectblacklight.org/catalog/facet/subject_topic_facet/
>>>> <mailto:blacklight-development%2Bunsu...@googlegroups.com> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/blacklight-development?hl=en.
>>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Blacklight Development" group.
>> To post to this group, send email to blacklight-...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> blacklight-develo...@googlegroups.com
>> <mailto:blacklight-development%2Bunsu...@googlegroups.com> .
This is an architectural principle I think we should adhere to, and it's
what our stuff currently mostly does.
Here's an example of the facet "more" stuff, that I think Chris is right
uses that view, on my server:
https://catalyst.library.jhu.edu/catalog/facet/language_facet