Expand my Community achievements bar.

SOLVED

Issue with excluding certain paths from search results.

Avatar

Level 2

Hi,

 

I need to exclude two paths from my search results and hence I have added my paths under property excludedPaths in the node: /oak:index/cqPageLucene-custom-11. But still I could see the two paths in the search results.
I have changed the reindex property to true, waited for some time so that it chnaged to false and the reindexCount got updated. Still could see the paths in search results.
Kindly help.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@STJ_1234 

 

I would suggest formulating the query as you expect the results to be:

path=/content/my-site/us/en
type=cq:Page

group.1_group.p.not=true
group.1_group.path=/content/my-site/us/en/services
group.1_group.path.self=true

group.2_group.p.not=true
group.2_group.path=/content/my-site/us/en/products
group.2_group.path.self=true

Src: https://sourcedcode.com/blog/aem/query-builder-api-exclude-pages-or-paths#google_vignette

 

Benefits:

  • When someone looks at the query, they know what to expect. 
  • This way the exclude paths in index are in sync with query, so changes of unexpected results reduce.

 

Also, please verify that when you do not use excludes in query, is it the custom index thats picked or any other.

 


Aanchal Sikka

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@STJ_1234 

 

I would suggest formulating the query as you expect the results to be:

path=/content/my-site/us/en
type=cq:Page

group.1_group.p.not=true
group.1_group.path=/content/my-site/us/en/services
group.1_group.path.self=true

group.2_group.p.not=true
group.2_group.path=/content/my-site/us/en/products
group.2_group.path.self=true

Src: https://sourcedcode.com/blog/aem/query-builder-api-exclude-pages-or-paths#google_vignette

 

Benefits:

  • When someone looks at the query, they know what to expect. 
  • This way the exclude paths in index are in sync with query, so changes of unexpected results reduce.

 

Also, please verify that when you do not use excludes in query, is it the custom index thats picked or any other.

 


Aanchal Sikka