Hi,
We have an xpath query for xml addon with the below and want to create a new oak index
/jcr:root/content/app/us/en/productguide_Product_Reference_Guide//*[(jcr:contains(., 'battery'))] order by @jcr:score descending
I checked on https://oakutils.appspot.com/generate/index
It showed the below .
<?xml version="1.0" encoding="UTF-8"?><jcr:root xmlns:nt=http://www.jcp.org/jcr/nt/1.0 xmlns:jcr=http://www.jcp.org/jcr/1.0>
<myIndex compatVersion="{Long}2" async="async" jcr:primaryType="oak:QueryIndexDefinition" evaluatePathRestrictions="{Boolean}true" type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:base jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured"/>
</nt:base>
</indexRules>
</myIndex>
</jcr:root>
Is it good practice to index the nt base like above without any named properties .Please suggest what could be alternative.
Note:- we are using the Adobe provided xml addon OOTB .
Regards,
Srinivas
Solved! Go to Solution.
Views
Replies
Total Likes
If the following value battery(as mentioned in your query) is associated with any property and specific node type then you can use Explain query [http://localhost:7070/libs/granite/operations/content/diagnosistools/queryPerformance.html] to compare query performance between "/jcr:root/content/app/us/en/productguide_Product_Reference_Guide//*[(jcr:contains(., 'battery'))] order by @jcr:score descending" and the query with named property, specific node [/jcr:root/content/we-retail/language-masters//element(*,cq:PageContent)[@sling:resourceType="weretail/components/structure/page"] order by @jcr:score].
I feel it will help you optimize your query and finally you will be able to create requisite oak indexing.
Personally I always follow below points while writing any query -
Please refer this : https://wttech.blog/blog/2020/jcr-query-performance/
If the following value battery(as mentioned in your query) is associated with any property and specific node type then you can use Explain query [http://localhost:7070/libs/granite/operations/content/diagnosistools/queryPerformance.html] to compare query performance between "/jcr:root/content/app/us/en/productguide_Product_Reference_Guide//*[(jcr:contains(., 'battery'))] order by @jcr:score descending" and the query with named property, specific node [/jcr:root/content/we-retail/language-masters//element(*,cq:PageContent)[@sling:resourceType="weretail/components/structure/page"] order by @jcr:score].
I feel it will help you optimize your query and finally you will be able to create requisite oak indexing.
Personally I always follow below points while writing any query -
Please refer this : https://wttech.blog/blog/2020/jcr-query-performance/
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies