Solr 的字符串集合是否需要值提供程序

Is there a value provider needed for a collection of string for Solr

Solr 的字符串集合是否需要值提供程序?它是开箱即用的,还是我们必须为此编写自己的值提供程序?

是的,您可以将 springELValueProviderSpring Expression Language (SpEL) 结合使用。

  1. 如果我们假设您的 collection 称为 myCollection :
public class ProductModel {

    //...

    List<String> myCollection;

    //...

}
  1. 然后创建一个 SolrIndexedProperty 如下:
INSERT_UPDATE SolrIndexedProperty   ; name[unique=true] ;type(code) ;multiValue[default=false]  ;fieldValueProvider     ;valueProviderParameter
                                    ; myCollection      ;string     ;true                       ;springELValueProvider  ;myCollection