You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (Jira)" <ji...@apache.org> on 2020/12/22 08:09:00 UTC

[jira] [Created] (OAK-9307) Oak: fulltext index / parent path restriction is missing

Thomas Mueller created OAK-9307:
-----------------------------------

             Summary: Oak: fulltext index / parent path restriction is missing
                 Key: OAK-9307
                 URL: https://issues.apache.org/jira/browse/OAK-9307
             Project: Jackrabbit Oak
          Issue Type: Bug
            Reporter: Thomas Mueller


In package org.apache.jackrabbit.oak.plugins.index.search.spi.query, FulltextIndex.shouldInclude, the "parent" path restriction is missing.

Potential patch (excluding test case):
{noformat}
    protected static boolean shouldInclude(String docPath, IndexPlan plan) {
        String path = getPathRestriction(plan);
        Filter filter = plan.getFilter();
        switch (filter.getPathRestriction()) {
        case EXACT:
            return path.equals(docPath);
        case DIRECT_CHILDREN:
            return PathUtils.getParentPath(docPath).equals(path);
        case ALL_CHILDREN:
            return PathUtils.isAncestor(path, docPath);
        case PARENT:
            return PathUtils.getParentPath(path).equals(docPath);
        case NO_RESTRICTION:
            return true;
        }
        throw new IllegalArgumentException("Unknown path restriction type " + filter.getPathRestriction());
    }
{noformat}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)