Use facets: Solr Admin

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

Procedure

The following steps drill down into the health census database that you set up in the basic tutorial. Use the Solr Admin to query the database using the age facet parameter in a query.

  1. Open the Solr Admin.
    http://localhost:8983/solr/
  2. In Core Selector, select the name of the Solr core, nhanes_ks.nhanes.
  3. Click Core Admin and then click Query.
  4. In the Solr Admin query form, specify a family size of 9 in the main query parameter text entry box--q:
    family_size:9
  5. In sort, specify sorting by age in ascending order, youngest to oldest:
    age asc
  6. 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.
  7. Select xml from the wt drop down.
    Output will appear in XML format.
  8. Select the facet option.
    Text entry boxes for entering facet parameter values appear.
  9. In facet.field, type this value:
    age
    The number of people in each age group will appear toward the end of the query results.
  10. 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.



  11. 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.



    To learn more about faceting, see Solr documentation.