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
BedrockMission!

Learn more

View all

Sign in to view all badges

Exclude pages from search and suggestions

Boobalan_M
Level 2
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.

3 Replies
Boobalan_M
Level 2
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!

hamidk92094312
Employee
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.