我有一个对象Foo
与 List<String>
属性名称:
class Foo {
List<String> names = []
}
在我的schema.xml
对于 Solr,我将其配置为字符串:
<field name="names" type="string" indexed="true" stored="true"/>
然后我尝试对其执行搜索,只要任何值与列表中的任何值匹配,我就期望命中:
new Criteria('names').in(filter.names)
但是,由于这些值在 Solr 中存储为逗号分隔的字符串,因此我没有返回任何结果。
我是否应该更改某些内容才能将字段拆分或参数化到列表中,以便我可以执行搜索?
最佳答案
一种可能的解决方案是使 solr 中的字段成为多值。
关于java - 使用 Spring Boot 在 Solr 中搜索逗号分隔的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30109596/