title: Indexing data in Hibernate Search
body: <p>I just started integrating Hibernate Search with my Hibernate application. The data is indexed by using Hibernate Session every time I start the server. </p>
  
  <pre><code>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     
  </code></pre>
  
  <p>It is very awkward and the server takes 10 minutes to start.
  Am I doing the this in right way?</p>
  
  <p>I wrote a scheduler which will update the indexes periodically. Will this update the existing index entries automatically, or create duplicate indices?</p>