Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9653

Adding the index tag option interferes with regex properties, leads to return zero results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.40.0
    • 1.42.0, 1.22.11
    • indexing
    • None

    Description

      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:

      +:ancestors:/test +:indexTag:x

      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

      Attachments

        Issue Links

          Activity

            People

              thomasm Thomas Mueller
              schulm Martin Schulze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: