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

Index updation fails on updating multivalued property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.15, 1.2
    • 1.0.17, 1.2.3, 1.3.3, 1.4
    • lucene
    • None

    Description

      On emptying a multivalued property, fulltext index updation fails and one can search on old values. Following test demonstrates the issue.
      Added below test in LuceneIndexQueryTest.java which should pass -

          @Test
          public void testMultiValuedPropUpdate() throws Exception {
              Tree test = root.getTree("/").addChild("test");
              String child = "child";
              String mulValuedProp = "prop";
              test.addChild(child).setProperty(mulValuedProp, of("foo","bar"), Type.STRINGS);
              root.commit();
              assertQuery(
                      "/jcr:root//*[jcr:contains(@" + mulValuedProp + ", 'foo')]",
                      "xpath", ImmutableList.of("/test/" + child));
              test.getChild(child).setProperty(mulValuedProp, new ArrayList<String>(), Type.STRINGS);
              root.commit();
              assertQuery(
                      "/jcr:root//*[jcr:contains(@" + mulValuedProp + ", 'foo')]",
                      "xpath", new ArrayList<String>());
      
              test.getChild(child).setProperty(mulValuedProp, of("bar"), Type.STRINGS);
              root.commit();
              assertQuery(
                      "/jcr:root//*[jcr:contains(@" + mulValuedProp + ", 'foo')]",
                      "xpath", new ArrayList<String>());
      
          }
      

      Attachments

        1. OAK-2999-v2.patch
          6 kB
          Amit Jain
        2. OAK-2999.patch
          10 kB
          Amit Jain

        Activity

          People

            amitjain Amit Jain
            maurya Rishabh Maurya
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: