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] [Created] (OAK-4804) Synonym with multiple words give more results than expected
Date Wed, 14 Sep 2016 16:33:20 GMT
Vikas Saurabh created OAK-4804:
----------------------------------

             Summary: Synonym with multiple words give more results than expected
                 Key: OAK-4804
                 URL: https://issues.apache.org/jira/browse/OAK-4804
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: lucene
            Reporter: Vikas Saurabh
            Assignee: Vikas Saurabh
            Priority: Minor


Setting up synonyms such as {{"FTW, For the win"}} would also return documents which contain
all of {{"For", "the", "win"}}.

Test case:
{noformat}
    @Test
    public void fulltextSearchWithPhraseSynonymAnalyzer() throws Exception {
        Tree idx = createFulltextIndex(root.getTree("/"), "test");
        TestUtil.useV2(idx);

        Tree anl = idx.addChild(LuceneIndexConstants.ANALYZERS).addChild(LuceneIndexConstants.ANL_DEFAULT);
        anl.addChild(LuceneIndexConstants.ANL_TOKENIZER).setProperty(LuceneIndexConstants.ANL_NAME,
"Standard");
        Tree synFilter = anl.addChild(LuceneIndexConstants.ANL_FILTERS).addChild("Synonym");
        synFilter.setProperty("synonyms", "syn.txt");
        synFilter.addChild("syn.txt").addChild(JCR_CONTENT).setProperty(JCR_DATA, "FTW, For
the win");

        Tree test = root.getTree("/").addChild("test");
        test.addChild("1").setProperty("foo", "FTW");
        test.addChild("2").setProperty("foo", "For the win");
        test.addChild("3").setProperty("foo", "For gods sake, this is not the way to win it");
        root.commit();

        assertQuery("select * from [nt:base] where CONTAINS(*, 'FTW') AND ISDESCENDANTNODE('/test')",
                asList("/test/1", "/test/2"));
    }
{noformat}



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

Mime
View raw message