Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Lucene Indexing for content fragment "unique" text field option

Avatar

Level 3

I have a content fragment with a text box that has the “unique” option enabled. When the fragment loads, it triggers the unique field validation call (/mnt/overlay/dam/cfm/admin/components/authoring/validations/uniquefield.json), but it doesn’t return any response.

In the Query Performance tool, I can see the following error:

“The query read or traversed more than 100000 nodes. To avoid affecting other tasks, processing was stopped.”

To fix this issue, I configured Lucene indexing for this query:

/jcr:root/content/dam//element(*, dam:cfVariationNode)[(@location = 'market')] option (index tag fragments)

I used the Oak Index Generator (https://thomasmueller.github.io/oakTools/indexDefGenerator.html to create the index definition. However, it didn’t work. After adding the configuration, the Content Fragment didn’t use the index. I tried restarting and reindexing, but there was no luck.\

What could be the issue?

 

{ "/oak:index/damcfVariationNodeLucene-12-custom-1": { "async": [ "async", "nrt" ], "compatVersion": 2, "evaluatePathRestrictions": true, "includedPaths": [ "/content/dam" ], "jcr:primaryType": "oak:QueryIndexDefinition", "queryPaths": [ "/content/dam" ], "selectionPolicy": "tag", "tags": [ "fragments" ], "type": "lucene", "indexRules": { "jcr:primaryType": "nt:unstructured", "dam:cfVariationNode": { "jcr:primaryType": "nt:unstructured", "properties": { "jcr:primaryType": "nt:unstructured", "location": { "jcr:primaryType": "nt:unstructured", "name": "str:location", "propertyIndex": true } } } } } }

 

vijayselvas1_1-1759998660340.png

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @vijayselvas1,

In your JSON you have:

"location": {
  "jcr:primaryType": "nt:unstructured",
  "name": "str:location",
  "propertyIndex": true
}

But the query you shared is:

/jcr:root/content/dam//element(*, dam:cfVariationNode)[(@location = 'market')]

The problem is that you’re using "name": "str:location". Oak interprets that literally as a string-typed property called str:location, not just location.

Instead, you should define it like this:

"location": {
  "propertyIndex": true,
  "name": "location",
  "type": "String"
}

 


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @vijayselvas1,

In your JSON you have:

"location": {
  "jcr:primaryType": "nt:unstructured",
  "name": "str:location",
  "propertyIndex": true
}

But the query you shared is:

/jcr:root/content/dam//element(*, dam:cfVariationNode)[(@location = 'market')]

The problem is that you’re using "name": "str:location". Oak interprets that literally as a string-typed property called str:location, not just location.

Instead, you should define it like this:

"location": {
  "propertyIndex": true,
  "name": "location",
  "type": "String"
}

 


Santosh Sai

AEM BlogsLinkedIn


Avatar

Level 3

Thanks @SantoshSai . It's working now.