Collections with Search Blueprints

Release Feature

When you create a search blueprint, you can enable it as a collection provider to display its results. Assets matching the blueprint’s query and configuration are added to the collection.

Important

Beginning in DXP 2025.Q3, more fields returned by a blueprint can be mapped to fragments in the collection display fragment. When the blueprint is configured to search only one content type (e.g., a single object or web content structure), you can map the type and subtype fields of objects, web content articles, and document types. Some content types do not fully register their fields with the necessary backend framework; these have more limited fields available for mapping to fragments. This includes bookmarks entries, dynamic data list records, message boards messages, form records, wiki pages, and all folders.

Before DXP 2025.Q3, only content registered with Liferay’s Asset Framework was returned by the blueprints collection provider. You could map the basic information fields (i.e., asset entry fields) in fragments, but the content’s type and subtype specific fields were not available (e.g., document, object, and web content fields).

Search blueprints are registered as collection providers.

To use a search blueprint’s collection provider,

  1. Enable the release feature flag for LPS-129412.

  2. Create a blueprint and configure it:

    • For 2025.Q3+, you must toggle the Enable as a Collection Provider switch.

    • Set the Searchable Types in the blueprint’s Query Settings. Beginning in 2025.Q3,your selection here influences the fields available for mapping to fragments in the collection display:

      • Select a single type of content (e.g., an object or web content structure) to use its specific fields for mapping in the Collection Display fragment.
      • If you choose multiple types or all types, only the basic fields common to all assets can be mapped in the collection display.
      • If you choose single type with multiple subtypes (e.g., multiple web content structures), only the fields common to the parent type are available.

    You can choose types and subtypes in the blueprint's Query Settings.

  3. In a content page’s editor, add the Collection Display fragment.

    You can also use the collection provider when adding collection pages.

  4. Choose the blueprint’s collection provider in the Collection Provider field.

  5. On a page, use a collection display fragment, select the collection provider, then map fields from the blueprint’s response to fragments.

    Map fields form the blueprint response to fragments in your collection display.

As with other collections, you can filter the blueprint-driven collection by keywords or categories with a collection filter.

Example: Showing File Entries from a Custom Document Type

Create documents and media files and configure a blueprint to display the events on a content page using the collection display fragment:

  1. Enable the release feature flag for LPS-129412.

  2. Create two new document types in Product Menu → Documents and Media → Document Types:

    • Create the Cat Photos type with one text field, Cat’s Name.
    • Create the Dog Photos type with one text field, Dog’s Name.

    Create two document types.

    Note

    To use the custom fields of these document types in the blueprints collection display, you must select a single type (Document) and a single subtype (e.g., Cat Photos) as the blueprint’s searchable type. If you select a second subtype (e.g., Dog Photos), only the shared fields from the Document type are available.

  3. Create one entry for each type in Product Menu → Documents and Media. Feel free to customize the example values:

    • Type: Cat Photos
      • Title: Priscilla lounging dramatically
      • Cat’s Name: Priscilla Tenderpaws
      • File: Upload a photo
    • Type: Dog Photos
      • Title: Foofy on the couch
      • Dog’s Name: Foofy Hernandez
      • File: Upload a photo

    Add an entry for each document type.

  4. From the Applications menu (Global Menu), open Blueprints.

  5. Add a blueprint that selects the searchable types:

    • Title: Pet Photos Blueprint
    • Enable as a Collection Provider: True (toggle the switcher)
    • Query Settings: select documents, then both document types (Dog Photos and Cat Photos) as the subtypes.

    Select both custom document types as the subtypes of Document.

  6. Save the blueprint.

  7. From the site menu (Site Menu), add a content page called Pets.

  8. Add the Collection Display fragment to the page and select the Pet Photos Blueprint Collection Provider.

    Your blueprint collection provider is now on the page.

  9. Add a Heading fragment to the collection display’s grid dropzone; then click the Heading Example text to open the mapping sidebar on the right.

  10. You can choose from any of the common Document fields, but not the pet name fields you added to your document types. Choose the title, which is a generic document field not specific to any document type.

    Map the title to the fragment.

  11. Now add an image fragment below the heading and map it to the document’s Preview Image field.

  12. Publish the page, and the collection shows both pets you added.

    Add your pet photos to the collection display.

To use a custom document type’s fields in the collection display, you must edit the blueprint, removing all but a single type/subtype pair (e.g., Document → Dog Photos). Then, reconfigure the collection display (you may need to start from scratch) and see that the custom fields are now available for mapping.

The single subtype's fields can be mapped in a collection display.

Example: Showing Future Events

Create calendar events and configure a blueprint to return only events that happen in the future. Display the events on a content page using the collection display fragment:

  1. Enable the release feature flag for LPS-129412.

  2. Create a page and add the Calendar widget to it.

  3. Create three calendar events:

    • Past Event: configure it to happen in the next five minutes and last 15 minutes (or less).
    • Future Event 1: Make an event that starts in the future.
    • Future Event 2: Make another event that occurs in the future.

    Three events are added to the Calendar widget.

  4. From the Applications menu (Global Menu), open Blueprints.

  5. In the Elements tab, 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}"
                                  }
                               }
                            }
                         }
                      ]
                   }
                ]
             }
          },
          "icon": "filter",
          "uiConfiguration": {}
       },
       "title_i18n": {
          "en_US": "Limit Results to Future Events."
       },
       "type": 0
    }
    
  6. In the Blueprints tab, build a blueprint to match only calendar events that are in the future:

    • Title: Enter Future Calendar Events Provider.
    • Enable as a Collection Provider: True (toggle the switcher).
    • Query Settings: select Calendar Events in Searchable Types.
    • Query Elements: add the Limit Results to Future Events element.
  7. Save the blueprint.

  8. From the site menu (Site Menu), add a content page called Upcoming Events.

  9. Add the Collection Display fragment to the page and select the Future Calendar Events Provider Collection Provider.

    Configure the collection display fragment to show a bullet list.

  10. Publish the page, and the future calendar events appear.

Only the future events are displayed in the collection display fragment.

Leverage blueprints to return your results dynamically, and reap the benefits of the fragments toolbox to lay out the page.