exclude page paths from search querybuilder | Community
Skip to main content
rajeevy89244319
Level 3
October 6, 2018

exclude page paths from search querybuilder

  • October 6, 2018
  • 1 reply
  • 10057 views

aem- I am trying to write a query to search all pages within specific root path but in the query we want to to pass page paths which needs to be excluded in search results. Any pointers on how to exclude specific page paths in query?

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

1 reply

Adobe Employee
October 8, 2018

Hello rajeevy89244319

Try something like below where the first operand indicated the path for your NOT criteria, second operand is for the path you wish to query, and third operand is basically a property to query.

select * from [cq:PageContent] where (NOT isdescendantnode([/content/we-retail/ca/en]) AND isdescendantnode([/content/we-retail/])) AND [jcr:title] is not null

Best Regards,

Aneet Arora

rajeevy89244319
Level 3
October 8, 2018

Thanks aneeta45259594​. I am trying to create predicate with not condition for page path to be excluded and add that predicate to the predicate group where the page root path for search is added. I tried setNegate method but that didnot work. i will try to give a try to direct query.