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 } } } } } }
Solved! Go to Solution.
Views
Replies
Total Likes
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"
}
Views
Replies
Total Likes
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"
}
Views
Replies
Total Likes
Thanks @SantoshSai . It's working now.
Views
Replies
Total Likes
Views
Likes
Replies