jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Saurabh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-3879) Lucene index / compatVersion 2: search for 'abc!' does not work
Date Sun, 31 Jan 2016 21:05:39 GMT

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

Vikas Saurabh commented on OAK-3879:
------------------------------------

So, here's \[0] a small test for the case I mentioned above. There are a couple of things
to notice:
* The plans for both approaches don't quite line up
** The query formed by using range query like _\[d TO f }_ got queried at lucene with _full:metadata/title:\[d
TO f} :fulltext:\[d TO f} ft:\("TO" "\[d" "f}")_
** The query with explicit props query got queried at lucene with _+metadata/title:\[d TO
\*] +metadata/title:\[\* TO f}_
* Results for both cases are different as property specific comparison don't match up. I'm
not sure but most probably this is because prop values aren't analyzed.

Maybe, there'd other cases that case use range queries. But more importantly, property range
queries isn't equivalent to range queries over analyzed values - which can service different
use cases.

\[0]
{code:java}
@Test
public void rangeQueries() throws Exception {
    Tree idx = createIndex("test1", of("propa", "propb"));
    Tree props = TestUtil.newRulePropTree(idx, NodeTypeConstants.NT_OAK_UNSTRUCTURED);
    enableForFullText(props, "metadata/title", false).setProperty(LuceneIndexConstants.PROP_ANALYZED,
true);

    root.commit();

    // create test data
    Tree test = root.getTree("/").addChild("test");
    for (String ch : "abcdefghijklmnopqrstuvwxyz".split("")) {
        if (ch.length() == 0)continue;

        usc(test, ch + "1").addChild("metadata").setProperty("title", ch + " title");
        usc(test, ch + "2").addChild("metadata").setProperty("title", "title " + ch + " title");
    }
    root.commit();

    String rangeQuery = "//element(*, " +  NodeTypeConstants.NT_OAK_UNSTRUCTURED + ")[jcr:contains(.,
'[d TO f}')]";
    assertOrderedQuery(rangeQuery, asList("/test/d1", "/test/d2", "/test/e1", "/test/e2"),
XPATH, true);

    String explicitQuery = "select [jcr:path] from [" + NodeTypeConstants.NT_OAK_UNSTRUCTURED
+
            "] where [metadata/title] >= 'd' AND [metadata/title] < 'f'";
    assertOrderedQuery(explicitQuery, asList("/test/d1", "/test/e1"), SQL2, true);
}
{code}

> Lucene index / compatVersion 2: search for 'abc!' does not work
> ---------------------------------------------------------------
>
>                 Key: OAK-3879
>                 URL: https://issues.apache.org/jira/browse/OAK-3879
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Thomas Mueller
>            Assignee: Chetan Mehrotra
>             Fix For: 1.3.15
>
>         Attachments: OAK-3879-v1.patch
>
>
> When using a Lucene fulltext index with compatVersion 2, then the following query does
not return any results. When using compatVersion 1, the correct result is returned.
> {noformat}
> SELECT * FROM [nt:unstructured] AS c 
> WHERE CONTAINS(c.[jcr:description], 'abc!') 
> AND ISDESCENDANTNODE(c, '/content')
> {noformat}
> With compatVersion 1 and 2, searching for just 'abc' works. Also, searching with '='
instead of 'contains' works.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message