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

Index definition on nt:base with analyzed property incorrectly matches query with different property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.33, 1.2.19, 1.4.7, 1.6.0
    • lucene
    • None

    Description

      With an index definition like below

          <fooIndex
              jcr:primaryType="oak:QueryIndexDefinition"
              async="async"
              compatVersion="{Long}2"
              type="lucene">
              <indexRules jcr:primaryType="nt:unstructured">
                  <nt:base jcr:primaryType="nt:unstructured">
                      <properties jcr:primaryType="nt:unstructured">
                          <newImport
                              jcr:primaryType="nt:unstructured"
                              analyzed="{Boolean}true"
                              name="bar"
                              propertyIndex="{Boolean}true"
                              type="String"/>
                      </properties>
                  </nt:base>
              </indexRules>
          </fooIndex>
      

      And a query like

      select [jcr:path] from [nt:base] where contains('foo', 'abc*')
      

      Previous index gets selected even though it does not index 'bar' property. Infact this index would match any query having different property

      Thanks to catholicon for reproducing the issue!

      Attachments

        Activity

          People

            chetanm Chetan Mehrotra
            chetanm Chetan Mehrotra
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: