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 "Vikas Saurabh (JIRA)" <ji...@apache.org> on 2016/01/05 18:50:39 UTC

[jira] [Updated] (OAK-3838) IndexPlanner incorrectly lets all full text indices to participate for suggest/spellcheck queries

     [ https://issues.apache.org/jira/browse/OAK-3838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikas Saurabh updated OAK-3838:
-------------------------------
    Attachment: OAK-3838.patch

Attaching [^OAK-3838.patch] where planner, for suggest/spellcheck queries, would validate:
* filter.selecter.nodeTypeName==indexingRule.baseNodeTypeName
* at least 1 property defn in the index def has useInSuggest/Spellcheck as appropriate.

The 'disable node type hierarchy' required a test case due to OAK-3156 (specifically {{LuceneIndexSuggestionTest#testSuggestQueryFromMoreGeneralNodeType}}) needed to be inverted.

Also, I had to expose a getter in SelectorImpl to get nodeTypeName.

[~chetanm], I left native query as is (instead of moving to hidden property def) because, native query inherently took care ignoring any other constraint. It does cause some string comparison for the {{value.startsWith("suggest?term="}} but apart from a bit of dirty code, going for non-native wouldn't have given any benefit.

[~teofili], [~chetanm] can you please review?

> IndexPlanner incorrectly lets all full text indices to participate for suggest/spellcheck queries
> -------------------------------------------------------------------------------------------------
>
>                 Key: OAK-3838
>                 URL: https://issues.apache.org/jira/browse/OAK-3838
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Vikas Saurabh
>            Assignee: Vikas Saurabh
>             Fix For: 1.4
>
>         Attachments: OAK-3838.patch
>
>
> Currently, index planner builds plan for suggest/spellcheck queries even if the indices don't have those functionality enabled.
> Also, there's another issue: when suggestion/spell-check come into play, we need to dis-allow inheritance behavior of indexingRule. To clarify, a query like {{SELECT [rep:suggest()] from [nt:unstructured] where suggest('test')}} if using some index preparing suggestions on {{nt:base}} would give incorrect suggestions as the index would have suggested values from other type of nodes as well.



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