Add an Options predicate

The Options predicate lets you add multiple search options in the Filters panel. You can select one or more of these options in the Filters panel to search for assets. For example, to search for assets based on file type, configure options, such as Images, Multimedia, Documents, and Archives in the search form. After you configure these options, the search is performed on assets of type GIF, JPEG, PNG, and so on, when you select the Images option in the Filters panel.

To map the options to the respective property, create a node structure for the options and provide the path of the parent node in the Property Name property of Options predicate. The parent node should be of type sling: OrderedFolder. The options should be of type nt:unstructured. The option nodes should have the properties jcr:title and value configured.

The jcr:title property is a user-friendly name for the option that is displayed on the Filters panel. The value field is used in the query to match the specified property.

When you select an option, the search is performed based on the value property of the option node and its child nodes, if any. The entire tree under the option node is traversed and the value property of each child node is combined using an OR operation to form the search query.

For example, if you select “Images” for file types, the search query for the assets is built by combining the value property using an OR operation. For example, the search query for images is built by combining the results matched for image/jpeg, image/gif, image/png, image/pjpeg, and image/tiff for the property jcr:content/metadata/dc:format using an OR operation.

Value property of a file type, as seen in CRXDE, is used for search queries to work

Value property of a file type, as seen in CRXDE, is used for search queries to work

Instead of manually creating a node structure for the options in the CRXDE repository, you can define the options in a JSON file by specifying corresponding key-value pairs. Specify the path of the JSON file in the Property Name field. For example, you can define the key-value pairs, image/bmp, image/gif, image/jpeg, and image/png and specify their values as shown in the following sample JSON file. In the Property Name field, you can specify the CRXDE path for this file.

{
    "options" :
 [
          {"value" : "image/bmp","text" : "BMP"},
          {"value" : "image/gif","text" : "GIF"},
          {"value" : "image/jpeg","text" : "JPEG"},
          {"value" : "image/png","text" : "PNG"}
 ]
}

If you want to use an existing node, specify it using the selection dialog.

NOTE
The Options predicate is a custom wrapper that includes property predicates to demonstrate the described behavior. Currently, there is no REST endpoint available to support the functionality natively.
  1. Click the Experience Manager logo, and then go to Tools > General > Search Forms.

  2. From the Search Forms page, select Assets Admin Search Rail, then click Edit.

  3. In the Edit Search Form page, drag Options Predicate from the Select Predicate tab to the main pane.

  4. In the Settings tab, enter a label and a name for the property. For example, to search assets based on their format, specify a user-friendly name for the label, for example, File Type. Specify the property based on which the search is to be performed in the property field, for example, jcr:content/metadata/dc:format.

  5. Do one of the following:

    • In the Property Name field, mention the path of the JSON file where you define the nodes for the options and specify corresponding key-value pairs.
    • Click the + symbol next to the Options field to specify the display text and value for the options you want to supply in the Filters panel. To add another option, click + symbol and repeat the step.
  6. Ensure that Single Select is cleared to let the user select multiple options for file types at a time (for example, Images, Documents, Multimedia, and Archives). If you select Single Select, the user can select only one option for file types at a time.

    The available fields in the Options predicate

    The available fields in the Options predicate

  7. In the Description field, enter an optional description and then click Done.

  8. Navigate to the Search panel. The Options predicate is added to the Search panel. The options for File Type are displayed as checkboxes.

Add a multi-value property predicate

The Multi Value Property predicate lets you search assets for multiple values. Consider a scenario where you have images of multiple products in Assets and the metadata for each image includes an SKU number associated with the product. You can use this predicate to search for product images based on multiple SKU numbers.

  1. Click the Experience Manager logo, and then go to Tools > General > Search Forms.
  2. On the Search Forms page, select Assets Admin Search Rail, the click Edit edit icon .
  3. In the Edit Search Form page, drag a Multi Value Property Predicate from the Select Predicate tab to the main pane.
  4. In the Settings tab, enter a label and placeholder text for the predicate. Specify the property name based on which the search is to be performed in the property field, for example, jcr:content/metadata/dc:value. You can also use the selection dialog to select a node.
  5. Ensure that Delimiter Support is selected. In the Input Delimiters field, specify delimiters to separate individual values. By default, comma is specified as the delimiter. You can specify a different delimiter.
  6. In the Description field, enter an optional description and then click Done.
  7. Navigate to the Filters panel in the Assets user interface. The Multi Value Property predicate is added to the panel.
  8. Specify multiple value in the Multi Value field separated by the delimiters and perform the search. The predicate fetches an exact text match for the values you specify.

Add a Tags predicate

The Tag predicate lets you perform tag-based searches for assets. By default, Assets searches assets for one or more tags matches based on the tags you specify. In other words, the search query performs an OR operation using the specified tags. However, you can use the match all tags option to search for assets that include all tags that you specify.

  1. Click the Experience Manager logo, and then go to Tools > General > Search Forms.

  2. From the Search Forms page, select Assets Admin Search Rail and then click Edit edit icon .

  3. In the Edit Search Form page, drag Tags Predicate from the Select Predicate tab to the main pane.

  4. In the Settings tab, enter a placeholder text for the predicate. Specify the property name based on which the search is to be performed in the property field, for example, jcr:content/metadata/cq:tags. Alternatively, you can select a node in CRXDE from the selection dialog.

  5. Configure the Root tags path property of this predicate to populate various tags in the Tags list.

  6. Select Show match all tags option to search for assets that include all tags that you specify.

  7. In the Description field, enter an optional description and then click Done.

  8. Navigate to the Search panel. The Tags predicate is added to the Search panel.

  9. Specify tags based on which you want to search assets or select from the list of suggestions.

  10. Select Match all to search for matches that include all tags that you specify.

Add other predicates

Similar to the way you add a Property predicate or an Options predicate, you can add the following additional predicates to the Search panel:

Predicate NameDescriptionProperties
FulltextSearch predicate to perform full text search on an entire asset node. It is mapped with the jcr:contains operator. You can specify a relative path if you want to perform a full text search on a specific part of the asset node.
  • Label
  • Placeholder
  • Property name
  • Description
Path BrowserSearch predicate to search for assets in folders and subfolders at a pre-configured root path
  • Placeholder
  • Root path
  • Description
PathUse it to filter results on location. You can specify different paths as options.
  • Label
  • Path
  • Description
Publish StatusSearch predicate to search assets based on their publishing status
  • Label
  • Property name
  • Description
Relative DateSearch predicate to search assets based on the relative date of their creation. For example, you can configure options, such as 2 months ago, 3 weeks ago, and so on.
  • Label
  • Property name
  • Relative date
RangeSearch predicate to search assets that lie within a specified range. In the Search panel, you can specify minimum and maximum values for the range.
  • Label
  • Property name
  • Description
Date RangeSearch predicate to search assets created within a specified range for a date property. In the Search panel, you can specify Start and End dates using date pickers.
  • Label
  • Placeholder
  • Property name
  • Range text (From)
  • Range text (To)
  • Description
DateSearch predicate for a slider-based search of assets based on a date property.
  • Label
  • Property name
  • Description
File SizeSearch predicate to search assets based on their size. It is a silder-based predicate where you select the slider options from a configurable node. The default options are defined at /libs/dam/options/predicates/filesize in the CRXDE repository. File size is provided in bytes.
  • Label
  • Property name
  • Path
  • Description
Asset Last ModifiedSearch predicate to search recently modified assets
  • Property name
  • Property value
  • Description
Publish StatusSearch predicate to search for assets based on their publishing status
  • Label
  • Property name
  • Description
RatingSearch predicate to search assets based on their average rating
  • Label
  • Property name
  • Option path
  • Description
Expiry StatusSearch predicate to search for assets based on their expiration status
  • Label
  • Property name
  • Description
HiddenSearch predicate that defines a hidden field property to search for assets
  • Property name
  • Property value
  • Description