Show a facet filter "All"

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

Show a facet filter "All"

PeterKerk
I have the facets below.
As you can see the number of results for that facet are behind it.
But I also want to show an option to the user that says "All (x results)". That would show the results if this filter was not used.
Do bear in mind that I have more facet filters so simply using the numFound value wont suffice.

Is there someway in the data-config or schema that I cant configure that?

<lst name="facet_counts">
<lst name="facet_queries"/>
        <lst name="facet_fields">
                <lst name="services_raw">
                        <int name="Exclusive rental">2</int>
                        <int name="Fotoreport">2</int>
                        <int name="Live music">1</int>
                </lst>
        </lst>
                <lst name="facet_dates"/>
        </lst>
</response>
Reply | Threaded
Open this post in threaded view
|

Re: Show a facet filter "All"

MitchK
Peter,

take a close look at tagging and and excluding filters: http://wiki.apache.org/solr/SimpleFacetParameters#LocalParams_for_faceting

Another way would be to index your services_raw as
services_raw/Exclusive rental
services_raw/Fotoreport
services_raw/Live music

In this case, you can use the facet-prefix param to get all the services_raw/*-values.
I am not sure, but maybe even "*" is a valid prefix - than you do not need such extra-work.

If all your documents include a services_raw-field, than this facet wouldn't make much sense, since it is applicable to all the documents, isn't it?

Kind regards,
- Mitch
Reply | Threaded
Open this post in threaded view
|

RE: Show a facet filter "All"

Jonathan Rochkind
In reply to this post by PeterKerk
The number of results if no filters from that facet were used is simply the total result count of the current search -- the search being returned by that query already is the results if no filters from that facet were used. The facet values are 'drill downs' into the current search.  So simply using the numFound seems like it will suffice to me, despite having multiple facets.  For every facet you have, the results if no filters from that facet were selected is numFound.

If what you need is something different, maybe describe more specifically your requirements. Is what you want for each "All" the total number of documents in your solr index?  I'm not really sure what you're trying to do.

Jonathan


________________________________________
From: PeterKerk [[hidden email]]
Sent: Sunday, September 05, 2010 8:51 AM
To: [hidden email]
Subject: Show a facet filter "All"

I have the facets below.
As you can see the number of results for that facet are behind it.
But I also want to show an option to the user that says "All (x results)".
That would show the results if this filter was not used.
Do bear in mind that I have more facet filters so simply using the numFound
value wont suffice.

Is there someway in the data-config or schema that I cant configure that?

<lst name="facet_counts">
<lst name="facet_queries"/>
        <lst name="facet_fields">
                <lst name="services_raw">
                        <int name="Exclusive rental">2</int>
                        <int name="Fotoreport">2</int>
                        <int name="Live music">1</int>
                </lst>
        </lst>
                <lst name="facet_dates"/>
        </lst>
</response>
--
View this message in context: http://lucene.472066.n3.nabble.com/Show-a-facet-filter-All-tp1421248p1421248.html
Sent from the Solr - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

RE: Show a facet filter "All"

PeterKerk
Just talking about it helped me in deciding this is not something I want :)

Thanks! :)