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

Lucene index may return the wrong result if path is excluded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • lucene
    • None

    Description

      If a query uses a Lucene index that has "excludedPaths", the query result may be wrong (not contain all matching nodes). This is case even if there is a property index available for the queried property. Example:

      Indexes:
      /oak:index/resourceType/type = "property"
      
      /oak:index/lucene/type = "lucene"
      /oak:index/lucene/excludedPaths = ["/etc"]
      /oak:index/lucene/indexRules/nt:base/properties/resourceType
      
      Query:
      /jcr:root/etc//*[jcr:like(@resourceType, "x%y")]
      
      Index cost:
      cost for /oak:index/resourceType is 1602.0
      cost for /oak:index/lucene is 1001.0
      
      Result:
      (empty)
      
      Expected result:
      /etc/a
      /etc/b
      

      Here, the lucene index is picked, even thought the query explicitly queries for /etc, and the lucene index has this path excluded.

      I think the lucene index should not be picked in case the index does not match the query path.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: