当涉及到多个值时,我很难理解 solr 3.4。我有这个 DIH:
<dataConfig>
<dataSource type="JdbcDataSource" name="********" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/lokal" user="****" password="******" />
<document>
<entity name="Search" transformer="RegexTransformer" query="select b_id, b_navn, b_cats, b_info, b_keyword, b_critical, b_geo, b_adress from searchbiz">
<field column="b_id" name="b_id" />
<field column="b_info" name="b_info" />
<field column="b_cats" name="b_cats" splitBy=","/>
</entity>
</document>
</dataConfig>
现在,我的问题是当这个 b_cats 被索引时,我得到了这个结果:
<arr name="b_adress">
<str>place1, place2</str>
</arr>
但我认为它应该是每个节点上都有一个节点。
当我尝试使用该字段进行分面时,我得到的是“place1, place2” = xx 结果,而不是 place1 = xx, and place2 xx。
任何人都可以指出我在这个问题上的正确方向吗?
谢谢;)
最佳答案
解决方法如下:
<dataConfig>
<dataSource type="JdbcDataSource" name="********" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/lokal" user="****" password="******" />
<document>
<entity name="Search" transformer="RegexTransformer" query="select b_id, b_navn, b_cats, b_info, b_keyword, b_critical, b_geo, b_adress from searchbiz">
<field column="b_id" name="b_id" />
<field column="b_info" name="b_info" />
<field column="b_cats" splitBy="," sourceColName="b_cats"/>
</entity>
</document>
关于solr - 将数据导入solr时拆分多值字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8971476/