Advanced tutorial steps for a faceted search based on a category of data.
Distributed pivot
faceting is supported. This advanced tutorial performs a
faceted search using the Solr Admin query form to drill down into filter search results
that are based on a category of data. Faceting is the arrangement of search results
into categories based on indexed terms. Searchers are presented with the indexed
terms, along with numerical counts of how many matching documents were found were
each term. Faceting makes it easy to explore search results by narrowing the search
results to what you are looking for.
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.
-
Open the Solr Admin.
http://localhost:8983/solr/
-
In Core Selector, select the name of the Solr core,
nhanes_ks.nhanes.
-
Click Core Admin and then click Query.
-
In the Solr Admin query form, specify a family size of 9 in the main query
parameter text entry box--q:
-
In sort, specify sorting by age in ascending order,
youngest to oldest:
-
In fl (filter list), specify returning only age and
family size in results:
Results from the main query will include only data about families of 9.
-
Select xml from the wt drop down.
Output will appear in XML format.
-
Select the facet option.
Text entry boxes for entering facet parameter values
appear.
-
In facet.field, type this value:
The number of people in each age group will appear toward the end of the query
results.
-
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.
-
Scroll to the end of the query form to see the facet results.