jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1518984 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index: aggregate/AggregateIndex.java nodetype/NodeTypeIndex.java property/PropertyIndex.java
Date Fri, 30 Aug 2013 14:50:44 GMT
Author: alexparvulescu
Date: Fri Aug 30 14:50:44 2013
New Revision: 1518984

URL: http://svn.apache.org/r1518984
Log:
OAK-983 Non full-text indices should ignore queries that have full-text constraints

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/aggregate/AggregateIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/aggregate/AggregateIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/aggregate/AggregateIndex.java?rev=1518984&r1=1518983&r2=1518984&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/aggregate/AggregateIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/aggregate/AggregateIndex.java
Fri Aug 30 14:50:44 2013
@@ -16,14 +16,12 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.aggregate;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.query.index.IndexRowImpl;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
-import org.apache.jackrabbit.oak.spi.query.Cursors;
 import org.apache.jackrabbit.oak.spi.query.Cursors.AbstractCursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java?rev=1518984&r1=1518983&r2=1518984&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java
Fri Aug 30 14:50:44 2013
@@ -37,6 +37,10 @@ class NodeTypeIndex implements QueryInde
 
     @Override
     public double getCost(Filter filter, NodeState root) {
+        if (filter.getFullTextConstraint() != null) {
+            // not an appropriate index for full-text search
+            return Double.POSITIVE_INFINITY;
+        }
         if (!hasNodeTypeRestriction(filter)) {
             // this is not an appropriate index if the filter
             // doesn't have a node type restriction

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java?rev=1518984&r1=1518983&r2=1518984&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndex.java
Fri Aug 30 14:50:44 2013
@@ -122,6 +122,11 @@ class PropertyIndex implements QueryInde
 
     @Override
     public double getCost(Filter filter, NodeState root) {
+        if (filter.getFullTextConstraint() != null) {
+            // not an appropriate index for full-text search
+            return Double.POSITIVE_INFINITY;
+        }
+
         PropertyIndexLookup lookup = new PropertyIndexLookup(root);
         for (PropertyRestriction pr : filter.getPropertyRestrictions()) {
             String propertyName = PathUtils.getName(pr.propertyName);
@@ -147,7 +152,7 @@ class PropertyIndex implements QueryInde
         // not an appropriate index
         return Double.POSITIVE_INFINITY;
     }
-    
+
     @Override
     public Cursor query(Filter filter, NodeState root) {
         Iterable<String> paths = null;



Mime
View raw message