Here's a faceted search I wrote:

http://www.mosaicresources.com.au/titles?q=george+r+martin

String facets were hard, so I avoided them.

The price and misc facets are all Boolean attributes. I have helpers
that parse the facets object and display the refine link if the true
count for each facet is greater than 0 and less than the current
result count.

The format and subject facets are all on foreign key ints, but
otherwise work in a similar way.

A library to replace my embarrassingly ugly helpers would be awesome,
will_facet anyone?

James

On 22 March 2011 22:12, Nicholas Faiz <[email protected]> wrote:
> Hi,
> I'm trying to set up a lot of facets for a library catalogue. It's the
> typical faceted search scenario: search 'abc', see n related facets (perhaps
> one called discipline, with a value of 'histories" and 150 matches), the
> user then clicks on histories and expects to see those 150 records.
> I've been configuring my facets as attributes, too, with the hope that
> something like the following will work:
> Book.facets 'abc', :facet => [:discipline], :with => {:discipling =>
> "histories"}
> With the attribute/facet discipline set as a string, though, inaccurate
> matching was the result (I'm using Postgres).
> After some reading I discovered the CRC type, and by converting the
> facets/attributes to CRCs. I can obtain accurate matches through rails
> console:
> Book.facets 'abc', :facet => [:discipline], :with => {:discipling =>
> "histories".to_crc}
>
> But the browsing experience is lost as all of the facet names are integers;
> so under the facet discipline I have lists of numbers.
> I coded this far into it, thinking there'd be a way to convert from the CRC
> representation for histories to the string representation (it's a Ruby
> encoding, after all).
> What are people doing to solve this problem
> Cheers,
> Nicholas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/thinking-sphinx?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to