Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
7.2. Manual optimization
You can programmatically optimize (defragment) a Lucene index from Hibernate Search through the
SearchFactory:
Example 7.2. Programmatic index optimization
FullTextSession fullTextSession = Search.getFullTextSession(regularSession);
SearchFactory searchFactory = fullTextSession.getSearchFactory();
searchFactory.optimize(Order.class);
// or
searchFactory.optimize();
The first example optimizes the Lucene index holding
Orders; the second, optimizes all indexes.
Note
searchFactory.optimize() has no effect on a JMS backend. You must apply the optimize operation on the Master node.