Expand my Community achievements bar.

SOLVED

Lucene Index in AEM

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 1

THank YOu.

Avatar

Level 1

Hi Amit,

IN Synchronous will the indexing happens only once or how it's?

Avatar

Community Advisor