db-config.xml中具有SplitBy的动态字段在Solr中无法正常工作

时间:2018-09-07 05:55:59

标签: sql-server solr solrcloud solr4 dih

我正在使用Solr 7.4.0,并使用DIH方法为数据建立索引。

在data-config.xml中查询

<entity name="Test" query="Select Names,Test_Value1,Test_Value2,Test_Value3 from TestTable">

        <field column="Names" name="Names" splitBy="," />
        <field column="Test_*" name="Test_*" splitBy="," />
</entity>

Schema.xml

<field name="Names" type="string" multiValued="true" indexed="true" />
<dynamicField name="Test_*" type="string" multiValued="true" indexed="true" />

完成索引编制后,名称很容易按以下方式分隔并根据需要将值显示为multiValue。
例如

"Names":["Demo1",
          "Demo2"]

但是在使用动态字段作为字符串类型multiValue时。 其在索引中显示此结果。

"Test_Value1":["Test 1, Test 2, Test 3"],         

但是我需要如下结果。

"Test_Value1":["Test 1", "Test 2", "Test 3"],

如上所示如何分隔动态字段值。

0 个答案:

没有答案