search and facets

190 views
Skip to first unread message

Jonathan Leibiusky

unread,
Dec 13, 2010, 8:31:00 AM12/13/10
to redi...@googlegroups.com
Hi everyone!
I'm working on this small and lightweight search engine based on redis and I was wondering how could I implement faceting in a good way.
I thought on different approaches but for now all of them include doing lots of calls to redis and I have the feeling there might be a better way to do that.
The approach I thought is the naive one: going through the results of the search and count (this won't show values with 0 number of results).

Any thoughts on this?

Thanks!

Jonathan

Josiah Carlson

unread,
Dec 13, 2010, 1:00:56 PM12/13/10
to redi...@googlegroups.com
On Mon, Dec 13, 2010 at 5:31 AM, Jonathan Leibiusky <iona...@gmail.com> wrote:
> Hi everyone!
> I'm working on this small and lightweight search engine based on redis and I
> was wondering how could I implement faceting in a good way.

Use a hash to store the values of a particular facet, like subject.

facets:subject -> <id>:<value>

Perform intersection across sets (for your search), and when it comes
to sorting your results, use SORT <result set> BY facets:subject .

> I thought on different approaches but for now all of them include doing lots
> of calls to redis and I have the feeling there might be a better way to do
> that.

The method I describe requires 2-3 calls:
1. intersect your sets
2. sort by your sorting mechanism and return all your results

OR

1. intersect your sets
2. sort by your sorting mechanism and store the results
3. make a call to fetch your "page" of results

> The approach I thought is the naive one: going through the results of the
> search and count (this won't show values with 0 number of results).

This should work, assuming you have the same idea of "faceted search"
as wikipedia.

- Josiah

Reply all
Reply to author
Forward
0 new messages