PathPredicateEvaluator 搜索两条路径

PathPredicateEvaluator search for two paths

我有一个使用 HashMap 和 QueryBuilder 的非常复杂的查询,其中一部分是这样的:

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

我从这个 page

中获取了该代码

这按预期工作,但我需要我的查询在两个可能的路径中搜索内容,因此它将在具有 "OR" 关系的两个路径中搜索。我还没有找到有关如何执行此操作的任何文档,我们将不胜感激。

您可以使用群组:

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

Documentation