Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Exclude pages from search and suggestions

Avatar

Level 2

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.

4 Replies

Avatar

Level 2

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!

Avatar

Employee

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.

Avatar

Level 2

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