schema.xml
<dynamicField name="*_str" type="string" indexed="true" stored="true"
required="false" multiValued="true"/>
文件对象:
@SolrDocument
public class Entity{
@Field("*_str")
private Map<String, String> identifiers;
SolrConfiguration as Java Class:
@Configuration
public Class SolrConfiguration{
@Bean
public CustomSolrTemplate solrTemplate() throws Exception {
SolrServer solrServer = solrServerFactoryBean().getObject();
CustomSolrTemplate customSolrTemplate = new
CustomSolrTemplate(solrServer);
customSolrTemplate.setSolrConverter(mappingSolrConverter());
return customSolrTemplate;
}
@Bean
public HttpSolrServerFactoryBean solrServerFactoryBean() {
HttpSolrServerFactoryBean factory = new HttpSolrServerFactoryBean();
factory.setUrl(solrServerUrl);
return factory;
}
@Bean
public SolrConverter mappingSolrConverter(){
return new MappingSolrConverter(new SimpleSolrMappingContext());
}
...
}
在阅读 solr.xml 时,仍未实例化@Field标识符。
我在这里做错了什么?