O'Reilly logo

Apache Solr 3 Enterprise Search Server by Eric Pugh, David Smiley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a filter query from a facet

When faceting is used, it is usually used in the context of faceted navigation in which a facet value becomes a navigation choice for the user to filter on. In Solr that becomes an additional filter query in a subsequent search. The total matching documents of that search should be equal to the facet value count. In this section we'll review how to build the filter queries. I won't show an example for facet query faceting because there's nothing to do—the facet query is a query and can be supplied directly as an fq parameter.

Note

To keep the filter queries easier to read I won't show them URL encoded.

Field value filter queries

For the case of field value faceting, consider the first example in the chapter where ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required