Hi @Sanj123 ,
There are two steps
1. Update the search facets with your custom property
2. Create a new custom oak index
/conf/global/settings/dam/search/facets/assets/.content.xml
This is used in AEM’s DAM search console (like /assets.html) to customize the faceted navigation for assets.
🛠 How to Update DAM Search Facets in AEM as a Cloud Service
📍 Location
Facets for the DAM search UI are stored under:
/conf/global/settings/dam/search/facets/assets
This path contains configurations (in .content.xml) that define which facets are shown (e.g., MIME type, tags, last modified) and their behavior.
✅ Example .content.xml
Here's a sample configuration:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Assets"
sling:resourceType="dam/gui/search/facetlist"
facets="[dc:format,cq:tags,jcr:content/metadata/prism:expirationDate]"/>
🧩 Explanation:
➕ Adding Custom Facets
To add a new facet (e.g., jcr:content/metadata/my:customField):
Ensure the metadata is part of your schema:
Update .content.xml (or use CRX/DE Lite):
facets="[dc:format,cq:tags,jcr:content/metadata/prism:expirationDate,jcr:content/metadata/my:customField]"
Deploy or Save Changes
If you're managing via code, deploy the updated .content.xml.
If via CRX/DE, just save the node.
Test in /assets.html UI.
⚠️ Notes
Do not use paths that are not indexed or stored. Ensure the custom metadata is saved and indexed.
For AEMaaCS, all /conf configurations should be deployed via content packages or Content as Code.
To properly support search facets on a custom metadata property in AEM as a Cloud Service (AEMaaCS), you must also create a custom Oak index for performance and functionality—especially for filtering and faceting in the DAM UI or custom searches.
✅ Steps to Create a Custom Index for a Custom Property in AEMaaCS
Let's say your custom property is:
jcr:content/metadata/my:customCategory
📁 1. Project Structure
Place the index definition here:
/apps/<your-project>/oak-index/myCustomCategoryIndex/.content.xml
🧾 2. Sample myCustomCategoryIndex/.content.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
jcr:primaryType="oak:QueryIndexDefinition"
compatVersion="{Long}2"
type="lucene"
async="[async]"
includedPaths="[/content/dam]"
indexRules="[dam:Asset]"
reindex="{Boolean}false"
name="myCustomCategoryIndex">
<indexRules jcr:primaryType="nt:unstructured">
<dam:Asset jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<myCustomCategory jcr:primaryType="nt:unstructured"
name="jcr:content/metadata/my:customCategory"
propertyIndex="true"
ordered="false"
analyzed="true"
nodeScopeIndex="true"/>
</properties>
</dam:Asset>
</indexRules>
</jcr:root>
📌 3. Key Properties Explained
Attribute Description
includedPaths | Restrict indexing to /content/dam (for performance). |
indexRules | Defines what node types and properties are indexed. |
propertyIndex | Enables exact-match indexing. |
analyzed | Enables full-text search on this property. |
nodeScopeIndex | Includes the property in full-text node-level indexing. |
🚀 4. Deploy the Index
Include the index under /apps in your AEM Maven module (typically ui.apps).
Define in filter.xml:
<filter root="/apps/your-project/oak-index/myCustomCategoryIndex"/>
Build and deploy your code via Cloud Manager or direct package install (for dev/test).
🔄 5. Reindex (Only If Needed)
If you're making changes and want to force reindexing:
Set reindex="{Boolean}true" temporarily.
Deploy and monitor logs for indexing to complete.
Then reset reindex to false.
👓 6. Verify
Use the AEM Query Builder Debugger (/libs/cq/search/content/querydebug.html) to test:
{
"path": "/content/dam",
"property": "jcr:content/metadata/my:customCategory",
"property.value": "ExampleValue"
}
Or test in the DAM UI (facets should now filter correctly and fast).
Would you like me to generate a complete sample AEM content package structure (filter.xml, content.xml, etc.) that you can directly integrate into your project?