I've just recently started using Hibernate Search, and I'm trying to figure out how I might go about indexing a single class into multiple indexes with slightly different information. Each index has a concept of "uniqueness" (@DocumentId), but the field needs to be different for each index. My initial reaction is that a single class can't support this. Is that correct?
So I have a single entity Foo that needs to be indexed in both index A and index B. Foo has multiple fields, including version and revision. Index A sees Foo as unique based on its version number. Index B sees Foo as unique based on its revision number.
I'm interested in any recommendations as to how I might go about this. I was thinking of some kind of inheritance, but that hasn't worked for me yet. I'm using a MySQL database, if it makes any difference.
Thanks,
Clay
|