You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Villemos, Gert" <ge...@logica.com> on 2009/02/24 00:27:41 UTC

Where are the facets configured?

New to Lucene / SOLr, but reading and learning fast.
 
I'm missing some fundamental mental link to understand how the facetted browsing works in SOLr. I have read the Wiki pages on facets and on configuration files. I have looked in the examples provided with SOLr. And searched Google / the mailing list. And yet something refuses to make click in my mind... (mental deficit?)
 
My problem is; where are the facets defined? I expect to se them in the configuration, yet I dont.
 
I see that document 'fields' are defined in the schema.xml / solrconfig.xml. And I see that 'facets' are used in the queries. 
 
1. Is the available facets based on the configured fields? A one-to-one mapping?
2. How can I then define sub-facets (i.e. 'Author' -> 'Ray Bradbury')?
3. Some places 'dynamic' facets are mentioned. What is that?
 
Sorry for this question which I fear is very basic. Thanks for all the good documentation.
 
Villemos.


Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


AW: Where are the facets configured?

Posted by "Villemos, Gert" <ge...@logica.com>.
>> My problem is; where are the facets defined? I expect to se them in the configuration, yet I dont.

>Solr can facet "on the fly".  The first time you request faceting on a
> field, it may take longer though as internal data structures are built
> and cached.  The only current requirement is that a field be indexed.

> Try it and see... simply add facet=on&facet.field=cat to a query on
> the example index.
 
 

The result is nicely ordered into facets, with elements with counts. Have I understood your answer correctly that the returned elements for the 'cat' facet searc, i.e. 'search', 'memory', 'graphics', etc, are all specific values that the indexed field 'cat' of an added documents have had?

I.e. there will be one document with something like

<add>

  <doc>

    <field name="cat">music</field>

    ...

and three documents with

    <field name="cat">electronic</field>

 


Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


Re: Where are the facets configured?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Feb 23, 2009 at 6:27 PM, Villemos, Gert
<ge...@logica.com> wrote:
> My problem is; where are the facets defined? I expect to se them in the configuration, yet I dont.

Solr can facet "on the fly".  The first time you request faceting on a
field, it may take longer though as internal data structures are built
and cached.  The only current requirement is that a field be indexed.

Try it and see... simply add facet=on&facet.field=cat to a query on
the example index.

> 2. How can I then define sub-facets (i.e. 'Author' -> 'Ray Bradbury')?

Facet values (facet constraints like 'Ray Bradbury') are unique
indexed terms for the field.

> 3. Some places 'dynamic' facets are mentioned. What is that?

Probably facet queries, where you can get the count for arbitrary
queries.  See facet.query params.


-Yonik
Lucene/Solr? http://www.lucidimagination.com