To get started using faceted search, enter a search term in the Search application’s search bar. You’ll see a page with results on the right and a collection of facets, with the number of search results for each facet (in parentheses) on the left.
Facets allow users to filter search results by some common characteristic. Think of facets as buckets that hold search results that share something in common. You might want to see the results from all the buckets (the master results list you’re first presented), but after scanning the results, you might decide the results from just one of the buckets better represent what you’re looking for (for example, all the results from a particular site, or all the results that are Blogs Entries). So what facets are included in Liferay DXP by default?
- Asset type
- Asset tag
- Asset category
- Modified date
In this article, explore how facets are used by end users, and learn how administrators can configure facets for their use case.
After a search is executed, clicking on a specific site from the Site facet filters the search results to only display assets within the specified site. Clicking on a specific user filters the search results to only display assets added by the specified user. The frequency with which the term was found for each facet is listed in parentheses after the facet. Sometimes, viewing assets with certain tags or categories is helpful.
Clicking on a facet narrows down the search results. It’s added to the filter list and the results list is refined by the selected facets. If you need to narrow the results further, click another facet (do this as much as you want to drill down into the search results). To remove any of the facets from the filtering of results, click the Any… link for the facet type. The following two figures illustrate how this works.
The default facet behavior is quite useful, but you can configure the facets to your liking.
To configure the Search application’s facets, click the options menu () and select Configuration. The tab displayed by default is Display Settings, and after the Scope setting, the Facets are listed with a Configure link you can click to expand the list of configurations for a given facet.
Facets are configurable to a considerable degree. The following configuration options are available:
Display Facet: Specifies whether the facet appears in search results.
- A floating point (or double) value used to determine the order facets appear in the search application. Facets with the largest values are positioned at the top.
- Frequency Threshold
- The minimum frequency required for terms to appear in the result list. For
example, if the frequency threshold of a facet is set to
3, a term appearing twice won’t appear in the term result list.
- Max Terms
- The maximum number of terms included in the search result regardless of how many matching terms are found for the facet.
- Show Asset Count
- Display the number of terms returned for the facet in the search results.
- Current/Available Assets (Asset Type facet only)
- Add or remove asset types to be included in the Asset Type facet.
- Display Style (Tag facet only)
- Display tags as a Cloud or List (default).
- Label (Modified Date facet only)
- The language key used for localizing the title of the facet when it’s rendered.
- Range (Modified Date facet only)
- Define an interval within all the matching terms frequencies’ are summed.
Asset Tags and Categories
If tags or categories have been applied to any asset that appears in the result
set, it may be displayed in the Asset Tag or Asset Category facet, respectively.
Similarly to asset types, not all tags necessarily appear. There may be many
more than the 10 tags listed, but the default configuration for this facet is to
show the top 10 most frequent terms. As with asset types, this can be modified
by setting the
Max Terms property, described above.
There’s no use in having great content if your site’s users can’t find it. The search functionality included in Liferay DXP is robust, configurable, and easy to use. It accounts for cases that include an overwhelming number of results, very few results, and anything in between.