Exclude pages from search and suggestions | Community
Skip to main content
Level 2
June 27, 2019

Exclude pages from search and suggestions

  • June 27, 2019
  • 2 replies
  • 4493 views

Hi,

We are using OOTB lucene to index the pages and properties. We have a requirement to exclude paths from search index dynamically. i.e the list of paths are not fixed and does not fall under a particular folder. The author should have an option to exclude any page from search at any moment. Due to this, the option to use excludePaths in the index node is not feasible.

We have introduced a property 'excludeinSearch' in page properties and restricting the search results by querying based on this property value. But the same doesn't work for Suggestions. Is there any way to customize the suggestions based on a property in page?

I believe it is difficult to restrict during the query time. Because the below query doesn't yield any result and it doesn't make sense. Because the suggestion dictionary might not be aware of the property.

SELECT [rep:suggest()] as suggestion FROM [cq:Page] as s WHERE ISDESCENDANTNODE(s, '/content/project/') AND suggest('test') AND s.excludeinSearch=false.

Can we make any customization to ignore the pages with this property from lucene index during reindexing time?

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
June 27, 2019

You can exclude specific contents form indexing:

How to exclude certain paths of content from being indexed

Level 2
June 28, 2019

Hi Hamid,

Thanks for your response. The above link seems to be configurations specific to versions <= CQ 5.5. We are using AEM 6.3 and not sure whether the same applicable here?

Thanks!

Adobe Employee
June 28, 2019

The idea is the same ... there might be some path diff that should be adjusted accordingly. There is no updated document as far as I can tell.

Level 2
March 14, 2022

Hi @boobalan_m ,

I have exactly similar requirement and struggling to achieve this.

Could you please tell me if you got any solution for this.

 

Thanks in advance