I have a solr schema with a dynamic field of different types. For example, in schema.xml there is:
<dynamicField name="*_s" type="string" indexed="true" stored="true"/> <dynamicField name="*_i" type="int" indexed="true" stored="true"/> <dynamicField name="*_l" type="long" indexed="true" stored="true"/> <dynamicField name="*_f" type="float" indexed="true" stored="true"/> <dynamicField name="*_d" type="double" indexed="true" stored="true"/>
And I want to access these fields using annotated POJO SolrJ. I know that I can have different map links for each data type in POJO, for example:
... @Field("*_s") public Map<String, String> strings; @Field("*_i") public Map<String, Integer> integers; ...
But is it possible to save all dynamic fields on one map? I thought something like:
... @Field("*_s") @Field("*_i") public Map<String, Object> dynamicFields; ...
The only documentation I can find about SolrJ, POJO, and dynamic fields is the old function request: https://issues.apache.org/jira/browse/SOLR-1129
Tim p source share