2 Replies Latest reply on Mar 3, 2012 12:51 PM by Anders Jespersen

    Best approach for database text index in JBoss 7 with hibernate search/infinspan/lucene ?

    Anders Jespersen Newbie

      We've got three tables with data from an LDAP-directory (external to the project).

      Rows are updated with a timestamp by LDAP drivers.


      In a JBoss 7.1.0.Final EAR deployment, we want to make these available as lucene-text-searchable entities.


      Supposedly, we'll set up a timer (@Scheduled EJB), that scans the database for new changes and reloads these in the cache.


      Which would be the better approach:


      1) Use JPA-entities and Hibernate Search

          a) configure hibernate.search.default.directory_provider=infinispan

          b) at startup Search.getFullTextEntityManager(entityManager).createIndexer()

          c) scan for updates and reload/evict them via JPA-entityManager


      2) Setup Infinispan-search, index cache

          a) at startup, load the data (JPA or JDBC) into the cache - infinispan does the lucene indexing

          b) scan for updates and add/update them in the cache


      I have parts of both working in testcode (not yet from within AS7..)



      - We'll never update the database from the application, it's readonly

      - the largest table is only ~35.000 rows 3-10 text columns to index

      - for now, this will run standalone only (no distribution necessary)


      Any advice much appreciated :-)