Search code examples
javaaem

PathPredicateEvaluator search for two paths


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

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.


Solution

  • you can use groups:

    map.put("group.1_path", "/content/path1");
    map.put("group.2_path", "/content/path2");
    map.put("group.p.or", "true");
    

    Documentation