Using facet helper behaviors in show views

43 views
Skip to first unread message

Tyler

unread,
May 21, 2012, 3:35:42 PM5/21/12
to blacklight-...@googlegroups.com
Hi All,

I've been looking into incorporating facet links into the display metadata in my show views, and I've been looking at the facet helper behaviors here:


Looking at the _facets.html.erb partial, I have a good idea how these helpers work in pulling facet values for the main index, but I'm curious as to how I could pull only facet values for a single item being shown. For example, in my metadata view, I'd like 'Subject' to list (and link to) the current item's values for my 'subject_facet' field. I assume render_facet_values would be useful here, but how do I limit it to the current item?

(disclosure: I'm technically working with Hydra, but that doesn't seem to conflict much when it comes to the faceting/solr side of things)

Thanks,

Tyler

Jonathan Rochkind

unread,
May 21, 2012, 4:04:45 PM5/21/12
to blacklight-...@googlegroups.com, Tyler
I don't think you want or need to use Solr faceting behavior for that.

The whole point of solr facetting behavior is to sum up these 'groups'
accross a result set.

For a single item, I'd just store those things in a multi-valued field,
make sure that multi-valued field is returned with your document fetch,
and then display em.

How can you get BL to do this? Can you use the BL facet rendering views
to do it? I am not sure, it wasn't designed for this and I don't think
anybody's tried to do it before, sorry, I have no answer.

One way or another, it's certainly something you can do (with or without
the existing views, you might need/want to make new view templates) --
but there's probably no simple switch you can flip or one line you can
add to your app to do it, it'll take some development.
> --
> You received this message because you are subscribed to the Google
> Groups "Blacklight Development" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/blacklight-development/-/6sywWSZ9Xw4J.
> 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.

Tyler

unread,
May 22, 2012, 9:09:12 AM5/22/12
to blacklight-...@googlegroups.com, Tyler
Thanks, Jonathan. I'll do some digging around to see what I come up with.

Tyler
> To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages