- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
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
- includedPaths - Optional multi value property. Defaults to ‘/’
- excludedPaths - Optional multi value property. Defaults to empty
- queryPaths - Optional multi value property. Defaults to ‘/’
- indexPath - Optional string property to specify index path
Hope this helps!!
Happy Coding 🙏
If you like my post and find it helpful, you can buy me a coffee.
Comments
Post a Comment