Patch from Shay Banon - founder of Compass. Here's the message included in the patch Shay sent:
I spent some time integrating Compass to the Appfuse DAO layer. I am attaching a patch that basically integrates with the Hibernate, JPA, and iBatis DAO implementations allowing to automatically mirror changes done through the DAO to the index, as well as performing full index operation (though Compass beans).
I have chosen to index the User object (with Address as component), which seems like it make sense. You can check the changes I made to the pom files and the dao xml files. Also, I needed to upgrade iBatis to its latest version so Compass can work with it.
I think that what is left to be done now is simply integrating search into the different view layers. I am no expert in it (I basically know Spring MVC, and in a superficial manner). I think it will be much faster for you to do that. I suggest creating a simple search action that uses the CompassSearchHelper.
If you want, we can also enhance the service layer to include a search service, though I am not sure if it is needed for the first go.
A quick breakdown of enabling search:
1. Added Searchable annotations to the User and Address.
2. Defined Compass bean, automatically scanning the model package for mapped searchable classes. It also automatically integrates with Spring transaction manager, and stores the index on the file system ([work dir]/target/test-index).
3. Defined CompassTemplate (similar in concept to HibernateTemplate).
4. Defined CompassSearchHelper. Really helps to perform search since it does pagination and so on.
5. Defined CompassGps, basically it allows for index operation allowing to completely reindex the data from the database. JPA and Hiberante also automatically mirror changes done through their API to the index. iBatis uses AOP.
I don't know if you want to create search.properties file or not. But if you want, it can easily be created and have Compass read it within the definition of the Compass bean.