Skip to content

Instantly share code, notes, and snippets.

@emmanuelbernard
Created December 9, 2010 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmanuelbernard/734974 to your computer and use it in GitHub Desktop.
Save emmanuelbernard/734974 to your computer and use it in GitHub Desktop.
public String rebuildIndex() throws InterruptedException {
FullTextEntityManager fullTextEntityManager = Search
.getFullTextEntityManager(entityManager);
Future<?> future = fullTextEntityManager.createIndexer()
.batchSizeToLoadObjects(30).threadsForSubsequentFetching(8)
.threadsToLoadObjects(4).cacheMode(CacheMode.NORMAL).start();
return future.isDone() ? "Index rebuilt successfully"
: "Index recreation in progress";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment