diff --git oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
index 41b1afe..69f2401 100644
--- oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/QueryIndex.java
@@ -19,14 +19,18 @@
 package org.apache.jackrabbit.oak.spi.query;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import javax.annotation.CheckForNull;
 
+import com.google.common.base.Preconditions;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.index.aggregate.NodeAggregator;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
+import static com.google.common.base.Preconditions.checkNotNull;
 import static org.apache.jackrabbit.oak.spi.query.Filter.PropertyRestriction;
 
 /**
@@ -285,6 +289,18 @@ public interface QueryIndex {
          * @return clone of current plan
          */
         IndexPlan copy();
+
+        /**
+         * Returns the value of the named attribute as an <code>Object</code>,
+         * or <code>null</code> if no attribute of the given name exists.
+         *
+         * @param name <code>String</code> specifying the name of
+         * the attribute
+         *
+         * @return an <code>Object</code> containing the value
+         * of the attribute, or <code>null</code> if the attribute does not exist
+         */
+        Object getAttribute(String name);
         
         /**
          * A builder for index plans.
@@ -302,6 +318,7 @@ public interface QueryIndex {
             protected NodeState definition;
             protected PropertyRestriction propRestriction;
             protected String pathPrefix = "/";
+            protected Map<String, Object> attributes = Collections.emptyMap();
 
             public Builder setCostPerExecution(double costPerExecution) {
                 this.costPerExecution = costPerExecution;
@@ -358,6 +375,12 @@ public interface QueryIndex {
                 return this;
             }
 
+            public Builder setAttributes(Map<String, Object> attributes){
+                checkNotNull(attributes);
+                this.attributes = attributes;
+                return this;
+            }
+
             public IndexPlan build() {
                 
                 return new IndexPlan() {
@@ -386,6 +409,8 @@ public interface QueryIndex {
                             Builder.this.propRestriction;
                     private final String pathPrefix =
                             Builder.this.pathPrefix;
+                    private final Map<String,Object> attributes =
+                            Builder.this.attributes;
 
                     @Override
                     public String toString() {
@@ -488,6 +513,11 @@ public interface QueryIndex {
                             throw new IllegalStateException(e);
                         }
                     }
+
+                    @Override
+                    public Object getAttribute(String name) {
+                        return attributes.get(name);
+                    }
                 };
             }
 
diff --git oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/AdvancedIndexTest.java oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/AdvancedIndexTest.java
index 2995a2c..4fb6269 100644
--- oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/AdvancedIndexTest.java
+++ oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/AdvancedIndexTest.java
@@ -18,6 +18,9 @@
  */
 package org.apache.jackrabbit.oak.query.index;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -56,5 +59,14 @@ public class AdvancedIndexTest {
         assertEquals(plan1.getFilter().getQueryStatement(), "SELECT * FROM [nt:file]");
         assertEquals(plan2.getFilter().getQueryStatement(), "SELECT * FROM [oak:Unstructured]");
     }
+
+    @Test
+    public void attribute() throws Exception{
+        Map<String, Object> attrs = new HashMap<String, Object>();
+        attrs.put("foo", "bar");
+        IndexPlan plan = new IndexPlan.Builder().setAttributes(attrs).build();
+
+        assertEquals("bar", plan.getAttribute("foo"));
+    }
     
 }
