[
https://issues.apache.org/jira/browse/OAK-2999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Amit Jain reassigned OAK-2999:
------------------------------
Assignee: Amit Jain (was: Chetan Mehrotra)
> Index updation fails on updating multivalued property
> -----------------------------------------------------
>
> Key: OAK-2999
> URL: https://issues.apache.org/jira/browse/OAK-2999
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: lucene
> Affects Versions: 1.2, 1.0.15
> Reporter: Rishabh Maurya
> Assignee: Amit Jain
> Fix For: 1.2.3, 1.3.2, 1.0.17
>
>
> 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|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java]
> which should pass -
> {code}
> @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>());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)