You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Rishabh Maurya (JIRA)" <ji...@apache.org> on 2015/06/16 17:25:03 UTC
[jira] [Updated] (OAK-2999) Index updation fails on updating
multivalued property
[ https://issues.apache.org/jira/browse/OAK-2999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rishabh Maurya updated OAK-2999:
--------------------------------
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|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}
> 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.0.15
> Reporter: Rishabh Maurya
>
> 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)