Hi,
Your approach would certainly work. A single ClassBridge or several FieldBridges should to the job. It is also ok to just mark class A as indexed.
The drawback of your solution is that your are limiting the ways you can search your index. Having separate field names gives you much more control over your queries (using Lucene's BooleanQuery) and it will be easier to change these queries over time.
That said, if you have a good reason why you want to index into one single field, go for custom bridges.
--Hardy
|