Expand my Community achievements bar.

path.self not working as expected

Avatar

Level 1

Hi Community,

 

I am having a requirement of including the parent path also in the search results. As an adobe provided implementation, I used path.self=true in my query. But this is causing the issue in the higher environment as this is resulting in the traversal query.

 

1_group.0_caseinsensitive.property = jcr:content/productCategories/item0/@name
1_group.5_caseinsensitive.property = jcr:content/@jcr:description
1_group.6_caseinsensitive.value = %wonder%
1_group.p.or = true
1_group.4_caseinsensitive.value = %wonder%
1_group.0_caseinsensitive.value = %wonder%
1_group.1_caseinsensitive.property = jcr:content/@longDescription
type = cq:Page
1_group.2_caseinsensitive.value = %wonder%
1_group.6_caseinsensitive.property = jcr:content/@jcr:title
path = /content/project-folder/folder/gb/en/products
1_group.2_caseinsensitive.property = jcr:content/@localSlogan
1_group.3_caseinsensitive.property = jcr:content/oem/*/items/*/@name
1_group.3_caseinsensitive.value = %wonder%
1_group.5_caseinsensitive.value = %wonder%
1_group.4_caseinsensitive.property = jcr:content/@name
1_group.1_caseinsensitive.value = %wonder%

Getting below results (1)

ssram1992_1-1674703576529.png

 

When I used path.self=true (Getting 2 results in 23 secs)

 

1_group.0_caseinsensitive.property = jcr:content/productCategories/item0/@name
1_group.5_caseinsensitive.property = jcr:content/@jcr:description
1_group.6_caseinsensitive.value = %wonder%
1_group.p.or = true
1_group.4_caseinsensitive.value = %wonder%
1_group.0_caseinsensitive.value = %wonder%
1_group.1_caseinsensitive.property = jcr:content/@longDescription
type = cq:Page
1_group.2_caseinsensitive.value = %wonder%
1_group.6_caseinsensitive.property = jcr:content/@jcr:title
path = /content/project-folder/folder/gb/en/products

path.self=true
1_group.2_caseinsensitive.property = jcr:content/@localSlogan
1_group.3_caseinsensitive.property = jcr:content/oem/*/items/*/@name
1_group.3_caseinsensitive.value = %wonder%
1_group.5_caseinsensitive.value = %wonder%
1_group.4_caseinsensitive.property = jcr:content/@name
1_group.1_caseinsensitive.value = %wonder%

 

 

ssram1992_0-1674703414990.png

 

The above screenshots are the results of the query from local. When I used these in higher environment. Search functionality stopped working. 

I tried to debug the query in explain query Query Performance, Because of the filtering predicates, I am not able to put the correct xpath and it is resulting into the traversal query. Can anyone please help me how can we include the filtering predicates (See above SS) in the xpath so that I can check the indexes in the right way.

Any help is appreciated.

 

Thanks 

 

2 Replies

Avatar

Community Advisor

Hi @ssram1992 

 

I did faced the same issue while creating custom sitemap and as a result wrote a query where path was homepage and wanted to include the homepage in results. I did use path.self=true and ended up traversal query.

Back then I could not find anything and since including path.self=true had such a performance impact, I found it better to include parent path separately and all checks needs to be applied using code logic. I guess its better to write separate code for inclusion of parent path.

 

thanks,

Nupur

Avatar

Level 1

Hi Nupur, 

 

Sorry for replying late!

In the existing set up we are using the multi field to include paths

ssram1992_0-1675232040664.png

I tried with using path.exact in the query but that was also not working, If that worked we would have used the separate section for home/parent pages. Can you please share your approach if that is feasible to share

 

Thanks