Index: src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java
===================================================================
--- src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java	(revision 1399662)
+++ src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexTest.java	(working copy)
@@ -73,4 +73,47 @@
         // assertTrue(withoutIndex > withIndex);
     }
 
+    @Test
+    public void testCustomConfigPropertyLookup() throws Exception {
+        NodeState root = MemoryNodeState.EMPTY_NODE;
+
+        // Add index definition
+        NodeBuilder builder = root.builder();
+        builder.child("oak:index").child("fooIndex").setProperty("pname", "foo");
+        NodeState before = builder.getNodeState();
+
+        // Add some content and process it through the property index hook
+        builder = before.builder();
+        builder.child("a").setProperty("foo", "abc");
+        builder.child("b").setProperty("foo", Arrays.asList("abc", "def"), Type.STRINGS);
+        // plus lots of dummy content to highlight the benefit of indexing
+        for (int i = 0; i < MANY; i++) {
+            builder.child("n" + i).setProperty("foo", "xyz");
+        }
+        NodeState after = builder.getNodeState();
+
+        // First check lookups without an index
+        PropertyIndexLookup lookup = new PropertyIndexLookup(after);
+        long withoutIndex = System.nanoTime();
+        assertEquals(ImmutableSet.of("a", "b"), lookup.find("foo", "abc"));
+        assertEquals(ImmutableSet.of("b"), lookup.find("foo", "def"));
+        assertEquals(ImmutableSet.of(), lookup.find("foo", "ghi"));
+        assertEquals(MANY, lookup.find("foo", "xyz").size());
+        withoutIndex = System.nanoTime() - withoutIndex;
+
+        // ... then see how adding an index affects the code
+        lookup = new PropertyIndexLookup(
+                new PropertyIndexHook().processCommit(before, after));
+        long withIndex = System.nanoTime();
+        assertEquals(ImmutableSet.of("a", "b"), lookup.find("foo", "abc"));
+        assertEquals(ImmutableSet.of("b"), lookup.find("foo", "def"));
+        assertEquals(ImmutableSet.of(), lookup.find("foo", "ghi"));
+        assertEquals(MANY, lookup.find("foo", "xyz").size());
+        withIndex = System.nanoTime() - withIndex;
+
+        // System.out.println("Index performance ratio: " + withoutIndex/withIndex);
+        // assertTrue(withoutIndex > withIndex);
+    }
+
+
 }
Index: src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt
===================================================================
--- src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt	(revision 1399662)
+++ src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt	(working copy)
@@ -120,10 +120,11 @@
 select * from [nt:base] as x where isdescendantnode(x, '/') and not isdescendantnode(x, '/jcr:system')
 /jcr:system
 /oak:index
-/oak:index/jcr:uuid
-/oak:index/rep:authorizableId
-/oak:index/rep:principalName
+/oak:index/authorizableId
+/oak:index/primaryType
+/oak:index/principalName
 /oak:index/test-index
+/oak:index/uuid
 /rep:security
 /rep:security/rep:authorizables
 /rep:security/rep:authorizables/rep:users
@@ -212,10 +213,11 @@
 /
 /jcr:system
 /oak:index
-/oak:index/jcr:uuid
-/oak:index/rep:authorizableId
-/oak:index/rep:principalName
+/oak:index/authorizableId
+/oak:index/primaryType
+/oak:index/principalName
 /oak:index/test-index
+/oak:index/uuid
 /rep:security
 /rep:security/rep:authorizables
 /rep:security/rep:authorizables/rep:users
@@ -243,10 +245,11 @@
 /
 /jcr:system
 /oak:index
-/oak:index/jcr:uuid
-/oak:index/rep:authorizableId
-/oak:index/rep:principalName
+/oak:index/authorizableId
+/oak:index/primaryType
+/oak:index/principalName
 /oak:index/test-index
+/oak:index/uuid
 /rep:security
 /rep:security/rep:authorizables
 /rep:security/rep:authorizables/rep:users
@@ -262,10 +265,11 @@
 /
 /jcr:system
 /oak:index
-/oak:index/jcr:uuid
-/oak:index/rep:authorizableId
-/oak:index/rep:principalName
+/oak:index/authorizableId
+/oak:index/primaryType
+/oak:index/principalName
 /oak:index/test-index
+/oak:index/uuid
 /rep:security
 /rep:security/rep:authorizables
 /rep:security/rep:authorizables/rep:users
Index: src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexDiff.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexDiff.java	(revision 1399662)
+++ src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexDiff.java	(working copy)
@@ -16,12 +16,16 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.property;
 
+import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
+import static org.apache.jackrabbit.oak.commons.PathUtils.concat;
+
 import java.util.List;
 import java.util.Map;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -50,16 +54,19 @@
         this.path = path;
         this.updates = updates;
 
-        if (node != null && node.hasChildNode("oak:index")) {
-            NodeBuilder index = node.child("oak:index");
+        if (node != null && node.hasChildNode(INDEX_DEFINITIONS_NAME)) {
+            NodeBuilder index = node.child(INDEX_DEFINITIONS_NAME);
             for (String indexName : index.getChildNodeNames()) {
-                List<PropertyIndexUpdate> list = updates.get(indexName);
+                NodeBuilder indexChild = index.child(indexName);
+                PropertyState ps = indexChild.getProperty("pname");
+                String propertyName = ps != null ? ps.getValue(Type.STRING)
+                        : indexName;
+                List<PropertyIndexUpdate> list = this.updates.get(propertyName);
                 if (list == null) {
                     list = Lists.newArrayList();
-                    updates.put(indexName, list);
+                    this.updates.put(propertyName, list);
                 }
-                list.add(new PropertyIndexUpdate(
-                        getPath(), index.child(indexName)));
+                list.add(new PropertyIndexUpdate(getPath(), indexChild));
             }
         }
     }
@@ -84,12 +91,7 @@
 
     private String getPath() {
         if (path == null) { // => parent != null
-            String parentPath = parent.getPath();
-            if ("/".equals(parentPath)) {
-                path = parentPath + name;
-            } else {
-                path = parentPath + "/" + name;
-            }
+            path = concat(parent.getPath(), name);
         }
         return path;
     }
@@ -136,8 +138,7 @@
     public void childNodeChanged(
             String name, NodeState before, NodeState after) {
         if (!NodeStateUtils.isHidden(name)) {
-            PropertyIndexDiff child = new PropertyIndexDiff(this, name);
-            after.compareAgainstBaseState(before, child);
+            after.compareAgainstBaseState(before, new PropertyIndexDiff(this, name));
         }
     }
 
Index: src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java	(revision 1399662)
+++ src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java	(working copy)
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.property;
 
+import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
+
 import java.util.Set;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
@@ -43,7 +45,7 @@
      * @param path lookup path
      */
     public boolean isIndexed(String name, String path) {
-        NodeState state = root.getChildNode("oak:index");
+        NodeState state = root.getChildNode(INDEX_DEFINITIONS_NAME);
         if (state != null) {
             state = state.getChildNode(name);
             if (state != null) {
@@ -72,7 +74,7 @@
         Set<String> paths = Sets.newHashSet();
 
         PropertyState property = null;
-        NodeState state = root.getChildNode("oak:index");
+        NodeState state = root.getChildNode(INDEX_DEFINITIONS_NAME);
         if (state != null) {
             state = state.getChildNode(name);
             if (state != null) {
Index: src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java	(revision 1399662)
+++ src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java	(working copy)
@@ -94,16 +94,22 @@
 
         if (!root.hasChildNode("oak:index")) {
             NodeBuilder index = root.child("oak:index");
-            index.child("jcr:uuid")
+            index.child("uuid")
                 .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
+                .setProperty("pname", "jcr:uuid")
                 .setProperty("unique", true);
+            index.child("primaryType")
+                .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
+                .setProperty("pname", "jcr:primaryType");
             // FIXME: user-mgt related unique properties (rep:authorizableId, rep:principalName) are implementation detail and not generic for repo
             // FIXME: rep:principalName only needs to be unique if defined with user/group nodes -> add defining nt-info to uniqueness constraint otherwise ac-editing will fail.
-            index.child("rep:authorizableId")
+            index.child("authorizableId")
                 .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
+                .setProperty("pname", "rep:authorizableId")
                 .setProperty("unique", true);
-            index.child("rep:principalName")
+            index.child("principalName")
                 .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
+                .setProperty("pname", "rep:principalName")
                 .setProperty("unique", true);
         }
         try {
