Details
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>()); }