Documentation

Using a Search Blueprint on a Search Page

By default, a search page does not have a search blueprint associated with it. A blueprint must be applied to a search page to affect the Liferay search experience. If a site has multiple search pages, follow the steps below on each page that should use a blueprint, as each must be configured separately. You can use different blueprints on each page, if desired.

To make the search page react to your search blueprint,

  1. Create a blueprint.

  2. Create or navigate to the search page.

  3. Add the Blueprint Options widget to the page.

  4. Click the widget’s Options icon (Options) and click Configuration.

  5. To choose a blueprint for the page, click Select.

    Select a blueprint for use on the page.

  6. Once the blueprint is selected, click Save on the Configuration screen.

Now the blueprint’s functionality is applied to the page.

Administrative users can instead use the Low Level Search Options widget to apply a blueprint to a search page. Open the widget’s configuration. In the Attributes section, add

  • Key: search.experiences.blueprint.id

  • Value: [the blueprint ID]

You can find the blueprint ID from the Blueprints application (Global Menu → Applications → Blueprints (Search Experiences).

The blueprint ID is listed in the Blueprints application.

Unless you’re already using the Low Level Search Options widget on your search page, the Blueprints Options widget is more convenient for setting a blueprint. If you must set other Search Context Attributes, perhaps for testing a blueprint, use the Low Level Search Options widget.

Applying Additional Search Context Attributes

Blueprints are applied to the page using the Blueprints Options widget, or using a search context attribute in the Low Level Search Options widget, as described above. Additional search context attributes can be set in the Low Level Search Options widget. There are two primary reasons you might need to set search context attributes into the search page:

  1. A blueprint can define and respond to a custom parameter (one that won’t be set by Liferay’s search framework), and these can be manually set in the Low Level Search Options widget.

  2. It can be useful to test the behavior of the blueprint on the search page by setting search context attributes and executing a search request.

    See the Elements reference for more information about the parameters used by the out of the box elements.