Building Search Experiences

With your content optimized for search, the next step is to build your search experiences. Liferay provides out-of-the-box tools that empower content managers and page creators to configure search pages and widgets to guide users smoothly toward the content they need. In this lesson, you’ll learn to design and set up search page layouts, filters, sorting, and displays.

The Liferay Search Page

At the heart of the search experience is the search page. This page is the same as any other Liferay page, though it includes specific widgets that work together to process a user’s query and return relevant assets (e.g., Search Bar, Search Results, Search Facets).

At the heart of the search experience is the search page.

There are a few ways to get started with a Liferay search page:

Approach Description
Use the Default Search Page Liferay’s default sites include a pre-built search page, ready to use immediately.
Use the Search Page Template Create a new widget page in your site using the built-in Search page template. This template includes all the standard search widgets already in place.
Create a Page from Scratch Build a completely custom search experience by starting with a blank content page and manually adding search widgets to it.
Convert a Widget Page to a Content Page Convert existing widget pages to content pages.

 

While widget pages offer a quick start, the recommended approach is to use a content page. They offer greater flexibility and support Liferay’s latest page building capabilities. With content pages, you can leverage fragments, personalization, and other modern features alongside your search widgets.

Shaping the Search Experience with Liferay’s Search Widgets

Once you have a search page, you can design layouts, add search widgets, and configure them to determine how the search page responds to user input. At a minimum, search pages should include a Search Bar, a Search Results display, and relevant Search Facets for narrowing results.

Proactive Search Bar Assistance

Beyond defining scope, the Search Bar widget includes options for further help users find what they’re looking for. One of the most effective ways to assist users is by providing helpful suggestions as they type. You can configure the Search Bar widget to provide real-time query suggestions. This proactive assistance guides users to popular topics, saves time by reducing typing, and circumvents typing mistakes that could lead to a failed search. For these reasons, enabling suggestions is a key step in creating a user-friendly and truly helpful search experience.

During configuration, you can control how and when suggestions appear. For instance, you can set a character threshold to determine the minimum number of characters a user must enter before suggestions appear. A lower number provides help faster, but a higher number can prevent irrelevant suggestions. Additionally, you can configure different sources for suggestions.

NOTE
By default, Search Bar suggestions use the regular search query. Liferay Enterprise Search users can influence or override the query using Search Blueprints.

To lead users directly to results, you can enable “Allow Empty Searches.” When users enter empty queries or simply load the search page, results are populated automatically. This both assures users that content exists and enables you to feature popular or promoted content.

Customizing the Results Display

The Search Results widget is highly configurable, giving you full control over how search results appear. You can set the widget’s display templates, choosing between card, compact, or list displays. With these options, you can switch between a simple list of titles to a detailed card display or a grid of cards with display images. In addition, you can highlight query terms in the results, configure pagination, and determine what happens when users click an item in the results.

The Search Results widget is highly configurable, giving you full control over how search results appear.

Empowering Users with Filters and Sorting

A great search experience gives users control over their results. After an initial query, you should enable them to narrow down and reorder the list to find exactly what they need. For this purpose, Liferay provides these widgets:

  • Facet Widgets: Facet widgets provide clickable filters that enable users to narrow down their results. Liferay provides several facet widgets, each based on different metadata. Some examples include the general Search Facet, Type Facet, and Category Facet widgets. You can also use the Custom Facets widget to filter based on specific fields in your content structures.
  • Sort Widget: The Sort widget enables users to re-order the results list. While results are sorted by relevance by default, users often need to see them in a different order, such as by modification date or alphabetically. This is especially useful when they are comparing multiple documents or products.

Including these widgets on your search page gives users the control they expect to navigate large result sets and find information efficiently.

Advanced Customization with Search Blueprints

Search Blueprints is an advanced, no-code feature for customizing the underlying search queries themselves. When standard widget configurations aren’t enough, blueprints enable you to go beyond page-level settings to implement powerful, site-wide search logic. That said, highly complex search logic may still require technical assistance.


 

Common use cases for Search Blueprints include:

  • Boosting results that have a specific tag (e.g., "promoted") or are from a specific source.
  • Re-weighting fields to make matches in a category title more important for a specific period of time.
  • Hiding an entire category of content from appearing on a specific search page.

In short, if you find the standard widget configurations do not meet your specific business requirement, leveraging Search Blueprints is often the solution.

NOTE
You can also leverage search blueprints for content presentation by creating collection providers based on your blueprints for more precise asset filtering. To learn more, consider taking the Mastering Liferay's Classic CMS course.

Clarity’s Search Pages

Clarity Vision Solutions has already applied some of these principles by creating a multi-faceted search strategy tailored to different audiences. Their goal is to ensure that whether a distributor is looking for product specifications or support articles, the search experience feels intuitive and leads them directly to the right content. Their strategy is built on the following key initiatives.

  • Create Distinct Search Experiences: Clarity recognizes that users looking for blog posts or policy documents have different needs than users searching for a specific pair of glasses. They use separate search pages for general content and for products, each with its own unique layout and set of facets, to provide a faster, more tailored way for users to find what they need.
  • Apply the Correct Search Scope: Since Clarity currently operates a single public website, all their search experiences are site-scoped, which works perfectly for now. As their business grows, they can consider enabling a global search if they add a separate B2B portal, allowing partners to find content across multiple sites from a single interface.
  • Build Hybrid Search and Display Pages: Clarity's main Products page is a primary example of a hybrid experience. It's designed as a visually engaging product showcase that also includes a search bar, facets, and sorting options, turning a simple display page into a powerful discovery tool for their eyewear collections.

Their goal is to ensure that the search experience feels intuitive and leads them directly to the right content.

By executing this strategy, Clarity can ensure their search is not just a utility, but a core part of a positive and effective user experience.

Conclusion

Liferay provides you everything you need to build great search experiences with out-of-the-box tools. With the search widgets and a thoughtful layout, you can shape how users search, how results appear, and how content is filtered and refined.

Next, you’ll help optimize Clarity’s search experiences.

loading-knowledge-label