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 page paths from search querybuilder

Avatar

Avatar
Validate 1
Level 2
rajeevy89244319
Level 2

Likes

10 likes

Total Posts

50 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
rajeevy89244319
Level 2

Likes

10 likes

Total Posts

50 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
rajeevy89244319
Level 2

06-10-2018

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?

Replies

Avatar

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 4
aneeta45259594
Level 4

Likes

46 likes

Total Posts

67 posts

Correct Reply

27 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
aneeta45259594
Level 4

08-10-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

Avatar

Avatar
Validate 1
Level 2
rajeevy89244319
Level 2

Likes

10 likes

Total Posts

50 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
rajeevy89244319
Level 2

Likes

10 likes

Total Posts

50 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
rajeevy89244319
Level 2

08-10-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.