Running a faceted search

A faceted search drills down to filter search results that are based on a category of data.

Procedure

Run a complex query and include facet parameters in the request.

  1. In the Solr Admin query form, specify a family size of 9 in the main query parameter text entry box--q:
    family_size:9
  2. In sort, specify sorting by age in ascending order, youngest to oldest:
    age asc
  3. In fl (filter list), specify returning only age and family size in results:
    age family_size
    Results from the main query will include only data about families of 9.
  4. Click the facet option.
    Text entry boxes for entering facet parameter values appear.
  5. In facet.field, type this value:
    age
    The number of people in each age group will appear toward the end of the query results.
  6. Click Execute Query.
    The numfound value shows that 186 families having nine members were found. The query results include only results from the fields in the filter list, age and family_size.

  7. Scroll to the end of the query form to see the facet results.
    The facet results show 11 people of age 17, 10 of age 34, and so on.

    You can learn more about faceting from Solr documentation.