I just start integrate Hibernate Search with my hibernate application. The data is indexed by using Hibernate Session everytime i start the server.
FullTextSession fullTextSession = Search.getFullTextSession(session);
Transaction tx = fullTextSession.beginTransaction();
List books = session.createQuery("from Book as book").list();
for (Book book : books) {
fullTextSession.index(book);
}
tx.commit(); //index is written at commit time
It is very much awkward. The server take time of 10 minute to start. Am i doing the things in write way?
I wrote a schedular which will update the indexes periodically. Is that the lucene update the existing column automatically or create a duplicate indexes?