Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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 

 

1 Accepted Solution

Avatar

Correct answer by
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

View solution in original post

1 Reply

Avatar

Correct answer by
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