| I don't think the fact that the custom bridge writes into multiple fields would make a difference. The parameters are per bridge, not per field. After all, parameters are totally up to the user, and so are the resulting fields. They could have a list of annotations, one for each resulting field, if they wanted to:
@MyCustomBridge(fields = {@MyCustomField(name = "foo", param = "someValue"), @MyCustomField(name = "bar", param = "someValue")})
On the other hand, some custom bridges may write to multiple fields without needing separate parameters for each field. I'm also a bit concerned with requiring people to write their own annotations. It's really simple, but not very common, so it might put some users off. We could offer some kind of "simpler" annotation, similar to what we had before 6.0, to make it possible to opt out:
@org.hibernate.search.annotations.Bridge(impl = MyCustomBridge.class, params = {@org.hibernate.search.annotations.Parameter(name = "foo", value = "someValue"), @org.hibernate.search.annotations.Parameter(name = "bar", value = "someValue")}
That would definitely be less powerful, though. And it could confuse users to have two ways of doing exactly the same thing. In the end, having a detailed example in the documentation might be a better solution. |