Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Custom Oak Indexes : AEM Part-1 (Custom Index Creation) | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

Custom Oak Indexes : AEM Part-1 (Custom Index Creation) by Bimmisoi

Abstract

With latest version of AEM, Oak does not index content by default, Custom indexes need to be created as per the requirement.If there is no index for a specific query, possibly many nodes will be traversed. The query may still work but probably be very slow. So let's quickly create a custom Index. We will explore below search features.

Synonyms Words
Stop Words
Autosuggestion
PorterStem & Lower Case
For Creating Lucene custom Index step please follow below steps

Open CRXDE and navigate to http://localhost:4502/crx/de/index.jsp
Navigate to /oak:index
Create node with jcr:primaryType = oak:QueryIndexDefinition

Index must have below properties while creating it
must be of type oak:QueryIndexDefinition
must have the type property set to lucene
must contain the async property set to the value async, this is what sends the index update process to a background thread

Click save all and save your changes.

Below are the non mandatory but useful properties that we can add for optimized indexing
compatVersion - Required integer property and should be set to 2
By default Oak uses older Lucene index implementation which does not supports property restrictions, index time aggregation etc. To make use of this feature set it to 2. Please note for full text indexing with compatVersion 2, at query time, only the access right of the parent (aggregate) node is checked, and the access right of the child nodes is not checked. If this is a security concern, then compatVersion should not be set, so that query time aggregation is used, in which case the access right of the relevant child is also checked. A compatVersion 2 full text index is usually faster to run queries.
evaluatePathRestrictions - Optional boolean property defaults to false
If enabled the index can evaluate path restrictions
includedPaths - Optional multi value property. Defaults to ‘/’
List of paths which should be included in indexing.
excludedPaths - Optional multi value property. Defaults to empty
List of paths which should be excluded from indexing.
queryPaths - Optional multi value property. Defaults to ‘/’
List of paths for which the index can be used to perform queries. Refer to Path Includes/Excludes for more details
indexPath - Optional string property to specify index path
Path of the index definition in the repository. For e.g. if the index definition is specified at /oak:index/lucene then set this path in indexPath

Read Full Blog

Custom Oak Indexes : AEM Part-1 (Custom Index Creation)

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies