【发布时间】:2021-07-27 08:41:16
【问题描述】:
在 Solr 8.9 中,我想通过拆分将字符串字段索引为列表。
它可以部分工作。
如果我的源字符串是A|B|C。
索引后,Solr 输出为:
"field": ["A|B|C", "A", B", "C"]
我希望它是:
"field": ["A", B", "C"]
谁能解释一下,为什么我的多值字段中有源字符串和拆分字符串?
我的data_config.xml
<document>
<entity name="items"
query="SELECT Id, Structures FROM Items"
transformer="RegexTransformer"
>
<field column="structures" splitBy="\|" sourceColName="Structures" />
</entity>
</document>
下面是schema.xml文件中的字段定义
<field name="structures" type="text_general" indexed="true" stored="true" multiValued="true" />
【问题讨论】:
-
它看起来像正则表达式问题。看看cwiki.apache.org/confluence/display/SOLR/… 并尝试调试