Automatically enumerating facets: is it possible?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatically enumerating facets: is it possible?

Paul Battley
I'm using Solr's facet-searching features to drill down into a
selection of documents, and I want to find the available sub-facets at
each stage, as explained on the wiki.

For example, if I have facets fields x and y, I can pass the following
parameters to enumerate the possible values for those fields:

facet=true&facet.field=x&facet.field=y

I then get something like (XML noise removed):
  x
    foo: 17
    bar: 6
  y
    baz: 3
    quux: 2

However, what I really want is for Solr to work this out
automatically, obviating the requirement to pass in x and y in the
query. I can't find any mention of the capability to do this, and yet
it seems like something that Solr might be able to do.

Can it be done?

Paul.
Reply | Threaded
Open this post in threaded view
|

RE: Automatically enumerating facets: is it possible?

Will Johnson
This is an interesting question.  Having worked at 2 of the major
enterprise search software vendors for the last 6 years I can say that
most all other engines out there do in fact handle this by default
however they do it at the expense of having to define all the fields you
want facets on before building the index.  Then if you want to add a
field later for faceting, guess what, you get to reindex all of your
content.  

Solr's model however seems to be much nicer in that you can define on
the fly what facets you want on a query by query basis and even allow
'users' to define their own facets.  (if you were crazy or have a
suitably small index) of course)

If all you want is some nice shorthand to turn on a pre-configured set
of facets you can set default on the standard / dismax request handlers
or write your own.

- will






-----Original Message-----
From: Paul Battley [mailto:[hidden email]]
Sent: Tuesday, April 24, 2007 10:34 AM
To: [hidden email]
Subject: Automatically enumerating facets: is it possible?

I'm using Solr's facet-searching features to drill down into a
selection of documents, and I want to find the available sub-facets at
each stage, as explained on the wiki.

For example, if I have facets fields x and y, I can pass the following
parameters to enumerate the possible values for those fields:

facet=true&facet.field=x&facet.field=y

I then get something like (XML noise removed):
  x
    foo: 17
    bar: 6
  y
    baz: 3
    quux: 2

However, what I really want is for Solr to work this out
automatically, obviating the requirement to pass in x and y in the
query. I can't find any mention of the capability to do this, and yet
it seems like something that Solr might be able to do.

Can it be done?

Paul.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically enumerating facets: is it possible?

Paul Battley
Thanks for the reply, Will; that cleared quite a lot of things up in my mind.

> If all you want is some nice shorthand to turn on a pre-configured set
> of facets you can set default on the standard / dismax request handlers
> or write your own.

That's a good idea, which might get me what I want, although your
reply has sent my mind down a slightly different track that might
actually end up giving better results.

Paul.
Reply | Threaded
Open this post in threaded view
|

RE: Automatically enumerating facets: is it possible?

Chris Hostetter-3
In reply to this post by Will Johnson
:
: Solr's model however seems to be much nicer in that you can define on
: the fly what facets you want on a query by query basis and even allow
: 'users' to define their own facets.  (if you were crazy or have a
: suitably small index) of course)

maybe not individual 'users' but client "applications" certainly ...
several Solr instances i work with have the dismax handler configured
several times with differnet defaults for each of several main use cases
... and then various client applications use one of these different
instances by specifing qt=blah based on their needs, but they can still
override any default values based on their specific needs.

first and formost the StandardRequestHandler and DisMaxRequestHandlers are
designed to be reusable by anyone and have lots of ways to tweak their
behavior (url params, config params, etc) ... but with only a little java
knowledge it's *really* easy to write a custom RequestHandler that can
implement whatever biz rules you might want.



-Hoss