Our documentation has been relocated here, the Liferay Developer Network. Please update your bookmarks!

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


Figure 1: Site and Type are two of the facet sets you’ll encounter.

A Facet aggregates search results by some common characteristic, with each facet holding search results that share something in common. After scanning the full list of results, a User might decide the results from just one facet are more appropriate (for example, all the results from a particular site, or all the results that are Blogs Entries). So what facets are included by default?

  • Site Facet for filtering results by their site.
  • Type Facet for filtering results by the Asset Type.
  • Tag Facet for filtering results by Tag.
  • Category Facet for filtering results by Category.
  • Folder Facet for filtering results by Folder.
  • User Facet for filtering results by the content creator.
  • Modified Facet for filtering results by the Last Modified Date.
  • Custom Facet for filtering results by some other indexed field. See here for more information.

Each item in a facet (selected using the checkbox) is called a Facet Term (term for short).

In this tutorial, you’ll explore how facets and their terms are used and how to find a facet’s configuration. The remaining articles show the configurations available for each facet.

Using Facets

If you’re not actually an accomplished oboe player, pretend for a moment. You’re visiting a site for classical musicians. You remember reading a great technical analysis of Johann Bach’s compositions, but you forgot to bookmark it (or would it be a bachmark?). You enter the keyword bach into the search bar and, because Johann Bach was a very important and famous composer, you get lots of results: too many, in fact. At first you’re discouraged, but you remember that there’s a site member who produces most of the site’s good technical content, who’s named back2bach. You see that his name is listed in the User facet, and there aren’t many results in the facet count (the number in parentheses next to the facet). You click into the facet and quickly find the content you wanted.


Figure 2: When presented lots of search results, facets narrow down the results list so users can find relevant content.

Clicking on a facet narrows down the search results. It’s added to the filter list in the search query, and the results list is refined by the selected facets.


Figure 3: After clicking the Web Content Article type in the Asset Types facet, it’s the only asset type listed.


Multiple Facet Selection

Facet term selections within one facet are additive. Clicking more terms in the same facet expands the search results, because it’s processed as if you want to see results matching Term-1 OR Term-2, OR etc. To remove all the term selections from a facet, click the Clear link.


Figure 4: Facet terms are additive when applied in the same facet. Any Blogs Entry OR Web Content article matching the keyword is shown here.

Facet term selections from different facets are exclusive. Clicking facet terms from multiple facets narrows the results because they’re processed as if you want to see results matching Facet-1 AND Facet-2, AND etc. This is intuitive. The facets


Figure 5: Facet terms selected from different facets are exclusive. These results must be of type Blogs Entry AND be from the User Marvin Smart.

Considering a case where you make two term selections in the Type Facet: (Blogs Entry and Web Content Article), and two term selections in the User Facet (James Jeffries and Marvin Smart). What results are displayed?

Blogs Entries OR Web Content Articles AND authored by James Jeffries OR Marvin Smart.

If Marvin and James each created four pieces of content (two blogs and two Web Content Articles), all eight would appear in the Search Results. Any Blogs or Web Content created by other Users are not shown, and assets of other Type created by Marvin and James are not displayed. Content that isn’t Blog Entries or Web Content Articles created by other Users are obviously not searched.


Figure 6: Both intra-facet and inter-facet selection is possible.

Facets and Friendly URLs

In the classic, monolithic Search portlet, URLs like this were not uncommon:


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


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


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


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


The parameter names are configurable for each facet.

Now that you know how facets work, read about configuring each of the included facets.

Site Facet

The Site Facet narrows search results down to those existing in a certain site. Each Site with content matching the searched keyword appears as a facet term. Figure 1: Each Site with matching...

קרא עוד

Type Facet

The Type Facet narrows search results down to those associated with a certain Asset Type. Each Type with content matching the searched keyword appears as a facet term. Figure 1: Each Asset Type...

קרא עוד

Tag and Category Facets

If tags or categories were applied to an asset appearing in the result set, they’re displayed in the Tag or Category facet, respectively. Like other facets with the Frequency Threshold...

קרא עוד

Folder Facet

The Folder Facet narrows search results down to those contained in a certain Asset Folder. If you search for space, a Folder titled Space Images doesn’t necessarily show up here. The content inside...

קרא עוד

User Facet

The User Facet narrows search results down to those created by a certain User. Figure 1: Each User with matching content is a facet term. The User Facet contains several configuration options:...

קרא עוד

Modified Facet

The Modified Facet narrows search results down to those that match the searched keyword and that were created or modified during a certain time period. Figure 1: Each time period with matching...

קרא עוד

Custom Facet

All Facets are configurable, allowing you to narrow down search results based on a shared characteristic (all Blog Entries, for example). The Custom Facet lets you create entirely new Facets. The...

קרא עוד
0 (0 הצבעות)
Searching for Assets קודם