Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUtils.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUtils.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUtils.java (working copy) @@ -103,13 +103,13 @@ * @param propertyNames * @param declaringNodeTypeNames */ - public static void createIndexDefinition(@Nonnull NodeUtil indexNode, + public static NodeUtil createIndexDefinition(@Nonnull NodeUtil indexNode, @Nonnull String indexDefName, boolean unique, @Nonnull String[] propertyNames, @Nullable String[] declaringNodeTypeNames) throws RepositoryException { - createIndexDefinition(indexNode, indexDefName, unique, propertyNames, declaringNodeTypeNames, PropertyIndexEditorProvider.TYPE); + return createIndexDefinition(indexNode, indexDefName, unique, propertyNames, declaringNodeTypeNames, PropertyIndexEditorProvider.TYPE); } /** @@ -123,20 +123,21 @@ * @param propertyIndexType * @throws RepositoryException */ - public static void createIndexDefinition(@Nonnull NodeUtil indexNode, + public static NodeUtil createIndexDefinition(@Nonnull NodeUtil indexNode, @Nonnull String indexDefName, boolean unique, @Nonnull String[] propertyNames, @Nullable String[] declaringNodeTypeNames, @Nonnull String propertyIndexType) throws RepositoryException { - createIndexDefinition(indexNode, indexDefName, unique, propertyNames, + return createIndexDefinition(indexNode, indexDefName, unique, propertyNames, declaringNodeTypeNames, propertyIndexType, null); } public static void createReferenceIndex(@Nonnull NodeBuilder index) { index.child(NodeReferenceConstants.NAME) .setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME) - .setProperty(TYPE_PROPERTY_NAME, NodeReferenceConstants.TYPE); + .setProperty(TYPE_PROPERTY_NAME, NodeReferenceConstants.TYPE) + .setProperty("info", "Oak index for reference lookup."); } public static boolean isIndexNodeType(NodeState state) { @@ -167,7 +168,7 @@ * @param properties any additional property to be added to the index definition. * @throws RepositoryException */ - public static void createIndexDefinition(@Nonnull NodeUtil indexNode, + public static NodeUtil createIndexDefinition(@Nonnull NodeUtil indexNode, @Nonnull String indexDefName, boolean unique, @Nonnull String[] propertyNames, @@ -190,6 +191,7 @@ entry.setString(k, properties.get(k)); } } + return entry; } /** @@ -205,7 +207,7 @@ * @param properties any additional property to be added to the index definition. * @throws RepositoryException */ - public static void createIndexDefinition(@Nonnull NodeBuilder indexNode, + public static NodeBuilder createIndexDefinition(@Nonnull NodeBuilder indexNode, @Nonnull String indexDefName, boolean unique, @Nonnull Iterable propertyNames, @@ -231,5 +233,6 @@ entry.setProperty(k, properties.get(k)); } } + return entry; } } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/package-info.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/package-info.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/package-info.java (working copy) @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@Version("3.0.0") +@Version("3.1.0") @Export(optional = "provide:=true") package org.apache.jackrabbit.oak.plugins.index; Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write/InitialContent.java (working copy) @@ -93,17 +93,25 @@ if (!builder.hasChildNode(IndexConstants.INDEX_DEFINITIONS_NAME)) { NodeBuilder index = IndexUtils.getOrCreateOakIndex(builder); - IndexUtils.createIndexDefinition(index, "uuid", true, true, + NodeBuilder uuid = IndexUtils.createIndexDefinition(index, "uuid", true, true, ImmutableList.of(JCR_UUID), null); - IndexUtils.createIndexDefinition(index, "nodetype", true, false, + uuid.setProperty("info", + "Oak index for UUID lookup (direct lookup of nodes with the mixin 'mix:referenceable')"); + NodeBuilder nodetype = IndexUtils.createIndexDefinition(index, "nodetype", true, false, ImmutableList.of(JCR_PRIMARYTYPE, JCR_MIXINTYPES), null); + nodetype.setProperty("info", + "Oak index for queries with node type, and possibly path restrictions, " + + "for example \"/jcr:root/content//element(*, mix:language)\""); IndexUtils.createReferenceIndex(index); index.child("counter") .setProperty(JCR_PRIMARYTYPE, INDEX_DEFINITIONS_NODE_TYPE, NAME) .setProperty(TYPE_PROPERTY_NAME, NodeCounterEditorProvider.TYPE) .setProperty(IndexConstants.ASYNC_PROPERTY_NAME, - IndexConstants.ASYNC_PROPERTY_NAME); + IndexConstants.ASYNC_PROPERTY_NAME) + .setProperty("info", "Oak index that allows to estimate " + + "how many nodes are stored below a given path, " + + "to decide whether traversing or using an index is faster."); } // squeeze node state before it is passed to store (OAK-2411) Index: oak-core/src/main/java/org/apache/jackrabbit/oak/query/package-info.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/query/package-info.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/query/package-info.java (working copy) @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@Version("4.0") +@Version("4.1") @Export(optional = "provide:=true") package org.apache.jackrabbit.oak.query; Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationInitializer.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationInitializer.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationInitializer.java (working copy) @@ -45,9 +45,12 @@ // property index for rep:principalName stored in ACEs NodeBuilder index = IndexUtils.getOrCreateOakIndex(builder); if (!index.hasChildNode("acPrincipalName")) { - IndexUtils.createIndexDefinition(index, "acPrincipalName", true, false, + NodeBuilder acPrincipalName = IndexUtils.createIndexDefinition(index, "acPrincipalName", true, false, ImmutableList.of(REP_PRINCIPAL_NAME), ImmutableList.of(NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_ACE)); + acPrincipalName.setProperty("info", + "Oak index used by authorization to quickly search a principal by name." + ); } // create the permission store and the root for this workspace. Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java (revision 1717917) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java (working copy) @@ -108,12 +108,18 @@ NodeUtil index = rootTree.getOrAddChild(IndexConstants.INDEX_DEFINITIONS_NAME, JcrConstants.NT_UNSTRUCTURED); if (!index.hasChild("authorizableId")) { - IndexUtils.createIndexDefinition(index, "authorizableId", true, new String[]{REP_AUTHORIZABLE_ID}, null); + NodeUtil authorizableId = IndexUtils.createIndexDefinition(index, "authorizableId", true, new String[]{REP_AUTHORIZABLE_ID}, null); + authorizableId.setString("info", + "Oak index used by the user management " + + "to quickly search an authorizable by id."); } if (!index.hasChild("principalName")) { - IndexUtils.createIndexDefinition(index, "principalName", true, + NodeUtil principalName = IndexUtils.createIndexDefinition(index, "principalName", true, new String[]{REP_PRINCIPAL_NAME}, new String[]{NT_REP_AUTHORIZABLE}); + principalName.setString("info", + "Oak index used by the user management " + + "to quickly search a prinipal by name."); } ConfigurationParameters params = userConfiguration.getParameters();