jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Saurabh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-8271) Lucene path transformed result doesn't accomodate wildcards in relative path
Date Wed, 24 Apr 2019 11:35:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-8271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825040#comment-16825040
] 

Vikas Saurabh commented on OAK-8271:
------------------------------------

The issue is that lucene implementation tries to match relative path fragment with path of
property (as stored in index) and returns only if relative path fragment is a suffix. So,
a diff like:
{noformat}
diff --git a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndexPlanner.java
b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndexPlanner.java
index 08196b428f..231ac10296 100644
--- a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndexPlanner.java
+++ b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndexPlanner.java
@@ -1027,10 +1027,7 @@ public class FulltextIndexPlanner {
         @Nullable
         public String transformPath(String path){
             if (isPathTransformed()){
-                // get the base path
-                // ensure the path ends with the given
-                // relative path
-                if (!path.endsWith(parentPathSegment)) {
+                if (getDepth(path) < parentDepth) {
                     return null;
                 }
                 return getAncestorPath(path, parentDepth);
{noformat}
fixes the issue.

I feel this (fix) is the right approach anyway as this then leaves the responsibility of matching
relative path with whatever we support (wildcard with prefix maybe) to query engine. [~tmueller]
wdyt?

> Lucene path transformed result doesn't accomodate wildcards in relative path
> ----------------------------------------------------------------------------
>
>                 Key: OAK-8271
>                 URL: https://issues.apache.org/jira/browse/OAK-8271
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Vikas Saurabh
>            Assignee: Vikas Saurabh
>            Priority: Minor
>
> {{LucenePropertyIndex}} support answering a query with property constraint on a relative
path if there's an property (non-relative) is indexed on {{nt:base}}.
> e.g. with an index def such as
> {noformat}
> + /oak:index/fooIndex/indexRules/nt:base/properties
>    + foo
>        - propertyIndex=true
> {noformat}
> we can answer queries such as
> {noformat}
> /jcr:root/a//element(*, some:type)[b/foo='bar']
> /jcr:root/a//element(*, some:type)[b/c/foo='bar']
> {noformat}
> In the same spirit it could also support query with wildcard in relative path fragment
> {noformat}
> /jcr:root/a//element(*, some:type)[b/*/foo='bar']
> {noformat}
> .... but it doesn't work currently.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message