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 2022/01/06 13:56:00 UTC

[jira] [Commented] (OAK-9653) Adding the index tag option interferes with regex properties, leads to return zero results

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

Thomas Mueller commented on OAK-9653:
-------------------------------------

I found that Elastic indexes are also affected. Working on a fix.

> Adding the index tag option interferes with regex properties, leads to return zero results
> ------------------------------------------------------------------------------------------
>
>                 Key: OAK-9653
>                 URL: https://issues.apache.org/jira/browse/OAK-9653
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: indexing
>    Affects Versions: 1.40.0
>            Reporter: Martin Schulze
>            Assignee: Thomas Mueller
>            Priority: Major
>
> I've experienced this behavior und the following circumstances:
>  * Query with an index tag option ("option (index tag x)")
>  * The index the tag has an regex property with REGEX_ALL_PROPS
> What happens is that the resulting query to lucene, which can be inspected in [1] is:
> {noformat}
> +:ancestors:/test +:indexTag:x{noformat}
> So the {{:indexTag}} will be added to the Lucene index as a property, because {{:indexTag}} matches the regex, which can be inspected in [2]
> I've added a failing unit test for this in [0].
> I've also tried to come around with a custom regex which excludes every node which starts with a colon ( regex: {{{}"^[^:\\/][^\\/]*$"{}}}). This leads to another problem where the index won't be selected (because the potential propery ":indexTag" does not matches the regex) and the query will traverse.
> [0] [https://github.com/apache/jackrabbit-oak/pull/448/files]
> [1] [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndex.java#L340]
> [2] [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java#L1500]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)