Solrj getBeans() 无法将响应放入 bean

Solrj getBeans() unable to fit response into bean

对于字段类型 text_general getbeans() 方法将该字段值作为 ArrayList() 返回,但 pojo 中的字段是字符串(虽然使用了相同的 pojo 索引)。而且我将 multiValued 属性设置为 false。

托管架构:

<field name="description" type="text_general" indexed="true" stored="true"/>

pojo 字段:

@Field("description")
private String description;
//getter-setter method

Java-代码:

SolrClient client = new HttpSolrClient.Builder("http://localhost:8983/solr/audiovideo").build();
    Scanner sc = new Scanner(System.in);
    System.out.println("Enter Serach : ");
    String search = sc.nextLine();
    SolrQuery query = new SolrQuery();
    query.setQuery("description:" + search);
    query.setStart(0);    
    QueryResponse response = client.query(query);             
    List<AudioVideoPojo> results = response.getBeans(AudioVideoPojo.class);

异常:

Exception in thread "main" org.apache.solr.client.solrj.beans.BindingException: Could not instantiate object of class com.mycompany.solrdemo1.AudioVideoPojo
at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBean(DocumentObjectBinder.java:71)
at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBeans(DocumentObjectBinder.java:50)
at org.apache.solr.client.solrj.response.QueryResponse.getBeans(QueryResponse.java:618)
at com.mycompany.solrdemo1.Main.getDataSolrFromDatabase(Main.java:155)
at com.mycompany.solrdemo1.Main.main(Main.java:131)
Caused by: org.apache.solr.client.solrj.beans.BindingException: Exception while setting value : [India International Music Festival] on private java.lang.String com.mycompany.solrdemo1.AudioVideoPojo.description
at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:455)
at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.inject(DocumentObjectBinder.java:438)
at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getBean(DocumentObjectBinder.java:67)

Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String field com.mycompany.solrdemo1.AudioVideoPojo.description to java.util.ArrayList
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.set(DocumentObjectBinder.java:449)

multiValued 属性设置为 false。根据参考指南,它默认为 false for fieldTypes。但它不遵守默认设置。