Hi mueller,
Lucene operations can't be rolled back; as of Lucene's API you could rollback changes you're applying to the index, but you can't search on them until a commit: so to be able to try out searches the changes need to be committed, using
flush will push pending changes to the backend (IndexWriter in default conf) and commit the operation so when using rollback you won't undo flushed changes.
Quote:
How do you test search with Hibernate Search?
For example tests you can find many in the framework testsuite itself, it was designed so that most tests can be used as API usage examples;
you can start by looking around here, organized per functional areas in sub-packages:
http://fisheye.jboss.org/browse/Hiberna ... earch/testor take a simple query example:
http://fisheye.jboss.org/browse/~raw,r= ... nTest.javaI'd suggest you checkout the code to look around in your ide, and then copy and adapt the SearchTest as you need into your project; the approach it uses is to create an in memory database and in memory index to run each test in isolation - cleaning up these resources at the end of each test, the drawback is that testsuite needs a full minute to run all 191 tests, but each test can override anything it needs: avoid the database, use a real (non-volatile) database, use a filesystem index, use a different configuration...
You don't need to use rollback strategies and can go for a complete use case scenario.