[ 
https://issues.apache.org/jira/browse/OAK-2999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589622#comment-14589622
 ] 

Amit Jain commented on OAK-2999:
--------------------------------

Sure

> 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: Chetan Mehrotra
>             Fix For: 1.3.1, 1.2.3, 1.0.16
>
>
> 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)

Reply via email to