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

Vikas Saurabh edited comment on OAK-4313 at 4/26/16 3:36 PM:
-------------------------------------------------------------

[~teofili] pointed me to OAK-2548. Changing exception->no results was done 
there.

Given we'd like to keep OAK-2548, another option could be that we can disable 
traversal index if filter contains a native query. [~tmueller], thoughts?

Possible patch:
{noformat}
diff --git 
a/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java 
b/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
index daaac7f..1882cdb 100644
--- a/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
+++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
@@ -947,7 +947,7 @@ public class QueryImpl implements Query {

     public SelectorExecutionPlan getBestSelectorExecutionPlan(FilterImpl 
filter) {
         return getBestSelectorExecutionPlan(context.getBaseState(), filter,
-                context.getIndexProvider(), traversalEnabled);
+                context.getIndexProvider(), traversalEnabled && 
!filter.containsNativeConstraint());
     }

     private SelectorExecutionPlan getBestSelectorExecutionPlan(
{noformat}


was (Author: catholicon):
[~teofili] pointed me to OAK-2548. Changing exception->no results was done 
there.

Given we'd like to keep OAK-2548, another option could be that we can disable 
traversal index if filter contains a native query. [~tmueller], thoughts?

> Query can scan whole repository for suggestion/spellcheck query when no index 
> supports those constraints
> --------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-4313
>                 URL: https://issues.apache.org/jira/browse/OAK-4313
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Vikas Saurabh
>            Assignee: Vikas Saurabh
>              Labels: candidate_oak_1_2, candidate_oak_1_4
>             Fix For: 1.6
>
>
> If no index supports suggestion (or spellcheck) query, then a query like
> {noformat}
> SELECT * from [nt:base] where SUGGEST('test')
> {noformat}
> would pick {{TraversingCursor}} where each row currently evaluates to false 
> and hence a whole repo scan.



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

Reply via email to