Lucene Index in AEM | Community
Skip to main content
March 25, 2025
Solved

Lucene Index in AEM

  • March 25, 2025
  • 2 replies
  • 590 views

Hi Team,

I would like to know on aem lucene indexing

As per the aem docs lucene is asyn means what operations does lucene do asynchronously in aem? 

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AmitVishwakarma

Hi @kummk123 ,

In AEM, Lucene indexing is asynchronous, meaning that indexing operations do not occur immediately upon changes to the repository but instead happen in the background at scheduled intervals.

What operations does Lucene do asynchronously in AEM?

1. Indexing Content Updates:

     - When nodes are added, modified, or deleted, Lucene does not index them instantly.

     - Instead, AEM batches these changes and processes them asynchronously during the next indexing cycle.


2. Re-indexing:

    - If you change an index definition (oak:index node changes), re-indexing is triggered in the background.

3. Commit and Merge Operations:

     - Lucene periodically commits indexed data to the repository and merges segments for better performance.


4. Full-Text Index Updates:

     - If an index includes full-text search ("type": "lucene" in oak:index), AEM processes and updates these full-text indexes asynchronously.

How Often Does Lucene Indexing Run?

     - AEM’s default indexing schedule is controlled by the Async Indexer, which runs approximately every 5 seconds (async index mode).

     - This can be adjusted via OSGi configurations under Apache Jackrabbit Oak Async Index Update.

How to Force Synchronous Indexing?

If you need immediate indexing:

     - Use oak:index properties:

          - "async": "sync" → Forces synchronous indexing.

          - "reindex": true → Triggers a full re-index.

Regards,
Amit

2 replies

AmitVishwakarma
Community Advisor
AmitVishwakarmaCommunity AdvisorAccepted solution
Community Advisor
March 25, 2025

Hi @kummk123 ,

In AEM, Lucene indexing is asynchronous, meaning that indexing operations do not occur immediately upon changes to the repository but instead happen in the background at scheduled intervals.

What operations does Lucene do asynchronously in AEM?

1. Indexing Content Updates:

     - When nodes are added, modified, or deleted, Lucene does not index them instantly.

     - Instead, AEM batches these changes and processes them asynchronously during the next indexing cycle.


2. Re-indexing:

    - If you change an index definition (oak:index node changes), re-indexing is triggered in the background.

3. Commit and Merge Operations:

     - Lucene periodically commits indexed data to the repository and merges segments for better performance.


4. Full-Text Index Updates:

     - If an index includes full-text search ("type": "lucene" in oak:index), AEM processes and updates these full-text indexes asynchronously.

How Often Does Lucene Indexing Run?

     - AEM’s default indexing schedule is controlled by the Async Indexer, which runs approximately every 5 seconds (async index mode).

     - This can be adjusted via OSGi configurations under Apache Jackrabbit Oak Async Index Update.

How to Force Synchronous Indexing?

If you need immediate indexing:

     - Use oak:index properties:

          - "async": "sync" → Forces synchronous indexing.

          - "reindex": true → Triggers a full re-index.

Regards,
Amit

Kummk123Author
March 25, 2025

THank YOu.

arunpatidar
Community Advisor
Community Advisor
March 25, 2025