What is Faceted Search
Before we start I will go through a little background on what faceted search is and where Solr fits into this. If you already know about faceted search - you can skip this part and move on to the next page - see the menu on the right.
Basic Keyword Relevance Search
The best example of this is Google. Everybody knows it. This is a screenshot from the UK site:
Note that you can semi-refine your search results by clicking on a radio button to search either the entire web, or just UK based sites. There is also the advanced search interface which will allow you to narrow down the results to just a specific URL, file type and change the keyword query into a phrase match, ignore specific words etc - this is not faceted search per se.
So here are the results listed in relevance order for the keyword query ’solr’1.
As you can see, there is a list of results, Google has integrated other information to the search results - you can see a NASDAQ stock quote for ‘SOLR’, a list of sub-links under the Apache Solr project page and so on. This is not faceted search.
To understand faceted search, I will be looking at a Job Board in Australia called CareerOne2. Or perhaps you want see an example of their faceted search for the keyword ‘Java’.
I have marked out the areas of interest from top to bottom, left to right.
In this space is where the current keyword query is displayed. Although not shown, underneath this would display a list of all of the selected refinements - sort of like a search breadcrumb display. Note the ‘Remove’ link which is like an ‘undo’ feature for the results.
NOTE: There is a difference between a Keyword parameter and a Facet parameter. The keyword is used to search against the text of the search index, the facets are used to refine the keyword search, thereby narrowing down the results.
For the current query keyword of ‘Java’ a list of all of the available facets are listed along with the number of results that can be expected.
NOTE:As a side example, when you click on the ‘Industry’ facet in the above example, a new facet is introduced - that of subcategory as seen below. This is known as hierarchical faceting.
The (advanced) search interface is included here to show how instead of doing just a
It is useful for the user to know how many results have been returned, and how many are displaying per page - this also links to the pagination below.
The user may want to sort by relevance (based on keyword) or on the date posted. In other examples, you may wish to order by the price of something, number of stars rating or even length/height/width of the item.
Being able to paginate through results is an obvious requirement
The actual details of the hits on the index. Note that other metadata (from the facet information) is also included:
- Date Posted
The Good News
The good news is that Solr does all of this for you and with ease. It may look daunting at the moment, but it will be plain sailing to get all of this done.
And that is faceted search, on to the brief history of Solr and the setup.