Also, looking at your example.
It is obvious that you want to get a feel for what Qi4j is. Let me point out that you (typically) will use @UnitOfWorkPropagation to handle the unit of work creation, retries and completions.
You annotate the transaction boundaries (methods) with the above annotation with values describing what you need. Often we also put the above annotation on all domain layer methods, but of the Mandatory type, to check that something has set up a UnitOfWork, and not simply calling anyway, to catch bugs early.
You might also be interested in UoWFile library, which allows file system changes to be bound by UnitOfWork as well (although I think it is not crash recoverable yet. Paul?).
In general, in case you are not aware, we separate the indexing from the storage. And we allow multiple stores to co-exist for different purposes, maybe a combination of SQL, LDAP, Cassandra for customers, users and sensor data respectively. Setting that up requires a little bit of Architecture planning, you know, whiteboard and square boxes in layers ;-) which is then set up in the application likewise.
Cheers
Niclas