Have you noticed that managing dynamic content collections in Liferay DXP 7.4 can be time-consuming and inconsistent. Manual configuration of asset displays leads to redundancy and complexity, especially as content scales. Liferay introduced a new BETA feature which automatically registers a collection provider for search blueprints. It aims to simplify this process, improve consistency, and reduce manual effort. However, users need clear guidance on how to implement this feature effectively for optimal results. Let's learn how we can use collection with search blueprints.
Note: Only the above versions of Liferay DXP 7.4 (U88) support these new BETA features.
Prerequisites
- Liferay DXP
- Liferay Blueprints
- Liferay Collections
What is Collection Provider?
Collection providers group items into collections for display on your pages. Several are available out of the box, or you can create them using the Information Framework to group items into the collections you need.
What is Blueprint?
A Search Blueprint is a design for Liferay's search functionality. Most consumers begin their search experiences with a Search Bar. With Search Blueprints, people can customize the search query to personalize their digital experience. You can override the elastic search query generated by Liferay Search to add your custom query and get search results based on that query using the Liferay Search Blueprint.
Let's Combine Blueprint and Collection
When you create a search blueprint with your custom query, a collection provider is automatically registered with the same title as the blueprint (just like Object definitions). Assets that match the blueprint's query and configuration are added to the collection.
Let's suppose that for a scenario which is "we want to create calendar events and based on those events, configure a blueprint to return only upcoming events (Future Events)."
- First, Enable the feature of Collection with search blueprints via Control Panel > Instance settings > Feature Flags > Beta: Collections with Search Blueprints.

- Create a page and add the calendar widget to the page.

- Now Create 3-4 events:
- Past Events: events that have already happened, before the present moment.
- Future Events: An occurrence or situation that is expected to happen at some point in the future but has not yet occurred.
- I've created past and future events as per the below images.
- Now, From the Applications menu, navigate to Search Experiences > Blueprints.
- In the Blueprints tab, make a blueprint to match only calendar events that are in the future:
- Title: Future Events Calendar.
- Query Settings: select Calendar Events in Searchable Types as per below image.

- Query Elements: From the right-side navigation menu, add a new custom element with this JSON.
{
"description_i18n": {
"en_US": "Limit results to only future events, using the endTime field."
},
"elementDefinition": {
"category": "filter",
"configuration": {
"queryConfiguration": {
"queryEntries": [
{
"clauses": [
{
"context": "query",
"occur": "filter",
"query": {
"range": {
"endTime": {
"gt": "${time.current_date|date_format=timestamp}"
}
}
}
}
]
}
]
}
}
}
}
- Save the blueprint.
- Now, from the site menu, add a content page called Upcoming Events.
- Add the Collection Display fragment to the page and select the Future Events Calendar Collection Provider.
- Configure the collection display fragment to show a bordered list as per below image.

- Publish the page, you will see all the upcoming events are displayed on the page as per below image.

- Now whenever a new event is created from the calendar, it will automatically display on the Upcoming Events page.
Limitation:
Currently, only content registered with Liferay's Asset Framework can be returned by the blueprints collection provider as Asset Entries. That is to say, it supports mapping of Asset Entry metadata (fields) only when building a content page.
Conclusion:
Liferay DXP 7.4's Collections with Search Blueprints feature makes dynamic content display easier by enabling users to filter and group content, such as calendar events, based on custom queries. This integration automatically registers a Collection Provider for each blueprint, easing the management of content and saving configuration time. Search Blueprints enables filtering based on criteria to personalize content easily, like showing only future events. Although it supports any content registered with the Asset Framework, this feature enhances scalability, simplifies maintenance, and improves user experience by delivering relevant, dynamic content effortlessly.