

In case it is missing, the node name will be used as a property name reference value. The propertyNames property indicates the list of the properties that will be stored in the index. The type property will specify the type of index, and in this case it must be set to property The Property Index has the following configuration options: This particular example will index the jcr:uuid property, whose job is to expose the universally unique idetifier (UUID) of the node it is attached to.

Set the following properties for the new node: Name the node PropertyIndex, and set the node type to oak:QueryIndexDefinition It can be configured by following the below procedure: The Property Index is generally useful for queries that have property constraints but are not full-text. For more information, see the configuration details for each indexer type below. Several configuration options are available for each indexer as node properties. The type of the index node must be oak:QueryIndexDefinition. Indexes are configured as nodes in the repository under the oak:index node. If re-indexing is needed in very large repositories, specially when using MongoDB and for full-text indexes, consider text pre-extraction, and using oak-run to build the initial index and to re-index. See also Troubleshooting Oak Indexes and Preventing Slow Re-indexing. This is true for both the initial creation of an index, and re-indexing (rebuilding an index after changing the definition). Configuring the indexesįor a large repository, building an index is a time consuming operation. Finally, the results are filtered, both to ensure that the current user has read access to the result and that the result matches the complete query. Once that is completed, the results from the cheapest index are retrieved. Next, each index is consulted to estimate the cost for the query. Then, the query is checked and transformed into SQL-2 which is the native language for Oak queries. The above diagram is a high level representation of the query execution mechanism of Apache Oak.įirst, the query is parsed into an Abstract Syntax Tree. Oak then chooses the indexer with the lowest estimated cost. If multiple indexers are available for a query, each available indexer estimates the cost of executing the query. This means that the content is not indexed and content nodes are traversed to find matches to the query. The Traversal Index is used if no other indexer is available. Implementations for Apache Lucene and Solr are also available by default, which both support fulltext indexing. One indexer is the Property Index, for which the index definition is stored in the repository itself. The Apache Oak based backend allows different indexers to be plugged into the repository. The Oak query engine supports the following languages: ) consider creating an index or changing the query If Oak encounters a query without an index, a WARN level log message is printed: *WARN* Traversed 1000 nodes with filter Filter(query=select. The query may still work but probably be very slow. If there is no index for a specific query, possibly many nodes will be traversed. Custom indexes need to be created when necessary, much like with traditional relational databases.


Unlike Jackrabbit 2, Oak does not index content by default. For best practices on optimizing query and indexing performance, see Best Practices for Queries and Indexing. This article is about configuring indexes in AEM 6.
