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.
SOLVED

PathPredicateEvaluator search for two paths

Avatar

Level 2

Hello

I have a really complex query using HashMap and the QueryBuilder, part of it has something like this:

        map.put("path", "/content");

        map.put("path.exact", "true"); // defaults to true

        map.put("path.flat", "true");

        map.put("path.self", "true");

I took that code from this page:
acs-aem-samples/SampleQueryBuilder.java at master · Adobe-Consulting-Services/acs-aem-samples · GitH...

this works as intended but I need my query to search for content in two possible paths, so it would be to search in two paths with an "OR" relationship. I haven't found any documentation on how to do that, any help will be appreciated.

1 Accepted Solution

Avatar

Correct answer by
Employee

Try this.

group.1_path=/content/x

group.2_path=/content/y

group.p.or=true

Query Builder API has more examples.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

Try this.

group.1_path=/content/x

group.2_path=/content/y

group.p.or=true

Query Builder API has more examples.