Hi,
I am using the below query in one of my workflows to search for a node name(article id) in AEM. This is to locate the folder with a particular article id where an asset needs to be moved. Please find the sample query used below
path=/content/dam/testfolder/test-assets
1_group.1_type = sling:Folder
1_group.2_type= sling:OrderedFolder
1_group.3_type=nt:folder
1_group.p.or=true
nodename=12345678_ea
This query is giving me node traversal errors and hence empty results. I tried creating a custom index for this query as per the below suggestion from oak index generator
Please find the screenshot of my custom index below
After this step, the query is still giving node traversal error and it is not even picking my custom index since the cost of OOB index is better than the custom index.
cost for [/oak:index/ntFolderDamLucene] of type (lucene-property) with plan [lucene:ntFolderDamLucene(/oak:index/ntFolderDamLucene) :ancestors:/content/dam/testfolder/test-assets] is 4303257.00
cost for [/oak:index/testFolderDamLucene] of type (lucene-property) with plan [lucene:testFolderDamLucene(/oak:index/testFolderDamLucene) +:ancestors:/content/dam/testfolder/test-assets +:nodeName:21022781_ea] is 6980484.00
How can I fix this issue? How can I optimize my query used to locate a particular matching node name? If not, how I can i improve the cost of my custom index so that it is picked to search just my specific folder? Appreciate if someone can help here.
Views
Replies
Total Likes
@Nitin_laad If you see my query, here I am trying to search for a node name and not an asset. path=/content/dam/testfolder/test-assets
1_group.1_type = sling:Folder
1_group.2_type= sling:OrderedFolder
1_group.3_type=nt:folder
1_group.p.or=true
nodename=12345678_ea
The JCR Query Cheat Sheet [1] says that the index definition must have the property "indexNodeName" set to true.
@Jörg_Hoh I have added that property to the nodes inside index rules already. As in the initial screenshot that was as per the index generated in the oak index generator. But still no luck
I think that the problem is that your index clashes with a different index. Can you check on Query performance tool which index is used by your query?
Is it possible to identify your results by a different criteria?
[1] http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html
@Jörg_Hoh Yes. As in my initial post. It is always picking OOB index lucene:testFolderDamLucene(/oak:index/testFolderDamLucene , since cost is better for this one
Can you just search for the node name and remove the constraint for folder types?
Views
Likes
Replies
Views
Likes
Replies