May 8, 2020
Estimated Post Reading Time ~

How to Create Search Predicates For Assets On AEM 6.2, 6.3, 6.4

This can be used to extend the default search capabilities of assets on AEM Author.

Step-by-step guide
1. Create a namespace, if you do not already have one.
2. Add your custom new metadata field to the default metadata profile. Or you can also create a new one.
  • Go to AEM Tools > Assets > Metadata Schemas > default > select “image” > Edit
  • I added a new Tab “Brand” for testing. You can also add a field to the default tabs as well.
  • Add a “Single Line Text” from the “Build Form” tab on the right.
  • Map to Property: ./jcr:content/metadata/brand:name( “brand” is the namespace )
3. Add a new search predicate to the assets’ search form
  • Go to AEM Tools > General > Search Forms > Select Assets Admin Search Rail > Edit
  • Add a Multi Value Property Predicate to the form. Use the same “Property Name” as used in 2(c) above.  Save
4. Add test metadata to the newly added field to some assets

5. Test your search predicates.
  • Go to AEM Navigation > Assets > Search (if on 6.3 then, AEM Navigation > Assets > Files > Search
  • Enter some search term.. or blank and hit search
  • Open filters.. you can see the newly added Brand Name search filter. Enter a search term like Nike, preferably something that matches with test data in 4(a)
I have tested this on AEM 6.2 and 6.3



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.