7.2. Manual optimization
You can programmatically optimize (defragment) a Lucene index from Hibernate Search through the
SearchFactory
:
Example 7.2. Programmatic index optimization
The first example optimizes the Lucene index holding
Order
s; the second, optimizes all indexes.
Note
searchFactory.optimize()
has no effect on a JMS back end. You must apply the optimize operation on the Master node.