Search Facets

Enter a keyword in the Search Bar and click the Search button. The default search experience redirects to a page with results on the right and a collection of facets on the left.

Example page of search results.

A facet aggregates search results by a common characteristic, or facet term.

Using Facets

Click one or more facet terms to filter through the search results efficiently. For example, if you search for documents related to Apollo, you can check a term in the Type facet.

Apollo search results filtered by type.

To look specifically for documents related to Apollo 11, you might also check the term in the folder facet.

Apollo search results filtered by folder.

In this way, you can pare down your search results.

Facet Selection

Selecting facet terms from different facets produces subtractive filtering (i.e., it uses the AND operator). That is, only results that match all of the filter criteria are returned.

However, selecting terms within an individual facet is additive (i.e., it uses the OR operator). That is, the combined results for each term are returned. For example, if you wanted to filter the search results for both the Apollo 11 folder and Apollo 14 folder, you could check both terms.

Apollo search results for both folders.

Whether facet selections are retained or cleared between searches depends on your Liferay version:

Prior to Liferay DXP 2024.Q2+/Portal GA120+, facet selections were retained between searches.

For Liferay DXP 2024.Q2+/Portal GA120+, facet selections are cleared by default when a new search term is entered, but the behavior is configurable. To retain facet selections across searches:

  1. Add the Search Options widget to the page and click Options (Options).
  2. Click Retain Facet Selections Across Searches.
  3. Click Save.

You can choose whether new searches retain or clear previous facet selections.

Facets and Friendly URLs

The Search functionality uses friendly search URLs for facet filtering. With default settings, here’s the default main search URL when searching for keyword test:

http://localhost:8080/web/guest/search?q=test

Selecting a facet term adds a new parameter to the above URL. For example, selecting Blogs Entry from the Type facet results in this URL:

http://localhost:8080/web/guest/search?q=test&type=com.liferay.blogs.model.BlogsEntry

Selecting another facet term from the same facet category appends the same parameter again, but with the newly selected value:

http://localhost:8080/web/guest/search?q=test&type=com.liferay.blogs.model.BlogsEntry&type=com.liferay.portal.kernel.model.User

The rest of the facets work the same way. Filtering by the last hour option in the Last Modified facet produces this URL:

http://localhost:8080/web/guest/search?q=test&modified=past-hour

The parameter names are configurable for each facet.

To learn more details of each facet type, refer to their individual articles.

Facet Counts and Permissions

Each bucket of facet terms includes a count of the results included. The indexed permissions are accounted for when counting the results. If the user has view permission on a document, it’s included and counted. Otherwise, it’s filtered out.

Because of a second round of more thorough permissions filtering accounting for dynamic permissions inheritance, the initial result and facet counts returned are not always accurate. You can configure search to provide more accurate counts, but there’s an unavoidable performance cost. If you must have more accurate counts at the cost of performance, configure the Permission Filtered Search Result Accurate Count Threshold, which is 0 by default. See Permissions and Search Results for more information. For example, setting 1000 as the accurate count threshold means that 1,000 documents are returned from the search engine and post-filtered down to the number the user can view before counting the results. Facet bucket counts and total result counts for all the returned documents up to 1,000 are accurate. If more than 1,000 documents are matched, the approximate count based on indexed permissions is added to the 1,000.

If you must customize the Permission Filtered Search Result Accurate Count Threshold, consider setting the same value in Search Query Result Window Limit to reduce the number of searches performed.

Dynamic permission inheritance applies to documents and media (folders and files), web content (folders and articles), message boards (categories and threads), bookmarks (folders and entries), wiki (nodes and pages), and categorization (vocabularies and categories).