- I want to use
QueryResponse.getBeans()
- I have classes defined in another project which does not have solr dependencies, so I can't use
@Field
on them
Is there an xml (or other externalized) alternative to @Field
?
Afaik there is no externalized standard way to this.
But there are probably some ways to achieve what you are trying to do:
- Copy solely the annotation to the different project with the same package. And annotate your bean.
- It is not possible to set annotations at runtime. These can be solved by using something like a adapter pattern(described here). I would prefer this because in the matter of style it seems to be a pretty clean solution.
Here is the issue about it: Solr are adding more flexibility.
I think this may help you.
http://wiki.apache.org/solr/SchemaXml
In the past I have also created my own versions of the classes from the other project and then provided a transformer to build my versions from the external classes I depend on. This transformer can work both ways and is easily tested.
精彩评论