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

Vikas Saurabh edited comment on OAK-3838 at 1/6/16 5:59 PM:
------------------------------------------------------------

Suggest and spellcheck queries get piggy-backed as native queries (of the form 
{{native-lucene=suggest?term=<text>}}).

For a node type {{Type2}} extending {{Type1}} and {{Mixin1}}, we get superTypes 
reported as {{Type1, Mixin1, Type2}}.

Currently, any indexing rule for super types would tend answer queries done on 
Type2. BUT, suggestions for indices for Type1 or Mixin1 would contain 
suggestion for nodes which are not on behalf of Type2 (thus containing 
extraneous data).

Usually, such extraneous data gets filtered by query engine. But, results from 
suggestion/spellchek is opaque to query engine and hence would bubble up all 
the way. 

To avoid this, we want to match {{nodeTypeName}} picked by selector exactly to 
indexing rule defined in the index. [~tmueller], is it fine if we expose 
{{nodeTypeName}} in {{Filter}} (like we do for mixinTypes, primaryTypes, 
superTypes)?


was (Author: catholicon):
Suggest and spellcheck queries get piggy-backed as native queries (of the form 
{{native-lucene=suggest?term=<text>}}). So, if a query wants suggestions on 
{{nt:unstructured}} while there's a lucene index on {{nt:base}}, we shouldn't 
let this index answer the query - as the index would give suggestion from other 
nodes (which are nt:base but not nt:unstructured). In usual cases, such 
extraneous results get filtered out by layers receiving rows from index - but 
the layers above would simply let all the rows go through.

To avoid this, we want to match {{nodeTypeName}} picked by selector exactly to 
indexing rule defined in the index. [~tmueller], is it fine if we expose 
{{nodeTypeName}} in {{Filter}} (like we do for mixinTypes, primaryTypes, etc)?

> 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)

Reply via email to