Hi.
We've been talking on the JUG Milano mailing list about the chance to use HibernateSearch for indexing while persisting Map with hibernate instead of Pojo. I change one sample project to persist Map in less than an hour following hibernate core docs this morning. Now is time to make Hibernate Search work again.
The sample app already has tests that now the search tests are broken. I need to make them green again: I am on this exception:
java.lang.IllegalArgumentException: Entity to index is not an @Indexed entity: java.util.HashMap
at org.hibernate.search.impl.FullTextSessionImpl.index(FullTextSessionImpl.java:186)
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.index(FullTextEntityManagerImpl.java:105)
Now I have different possible ways: read the doc about programmatically add HSearch:
http://bit.ly/e9oo4q should be the first but I am also thinink: what about a generic "KeyValue" object where I can put @Indexed annotations over and where I can reuse all hibernate search annotations (and developer knowledge) without forcing me or other devs to use annotations with pojos and java when persisting maps?
We were talking about the possibility to adapt this model to a generic key-value store, I am experimenting with MongoDB actually. I am wondering about pros and cons of having a generic class with annotations.
The other way is: remove annotations and go the programmatic way, and there is the doc for that, I'll be back if I'll find problems.
I'd like to discuss about this solutions and the generic topic with the community.
Sumarizing: focus here is to persist Map on a RDBMS with hibernate, or also changing the storage with a document DB or even a Key-Value store. Over this, I want to keep Hibernate Search as indexing engine.