【问题标题】:SOLR - split string field into listSOLR - 将字符串字段拆分为列表
【发布时间】: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" />

【问题讨论】:

标签: indexing split solr


【解决方案1】:

更改我的列名后已解决。

我在data_config.xml 的查询:

query="SELECT Id, Structures as structures FROM Items"

schema.xml文件中的字段定义

<field column="structures" splitBy="\|" sourceColName="structures" />

【讨论】:

    猜你喜欢
    • 2023-04-01
    • 2019-04-16
    • 1970-01-01
    • 1970-01-01
    • 2015-09-01
    • 2011-11-13
    • 1970-01-01
    • 1970-01-01
    • 2018-10-24
    相关资源
    最近更新 更多