将数据导入solr时拆分多值字段

发布于 2024-12-28 22:56:07 字数 1058 浏览 2 评论 0原文

当涉及到多个值时,我在理解 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 和 place2 xx。

有人能指出我在这个问题上的正确方向吗?

谢谢 ;)

I'm having a bit of trouble getting my head around solr 3.4 when it comes to multiple values. I have this 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>

Now, my problem is when this b_cats is index'ed Im getting this result :

<arr name="b_adress">
  <str>place1, place2</str>
</arr>

But I thought it should be one node on each.

When I try to facet using this field, I'm getting "place1, place2" = xx result, instead of place1 = xx, and place2 xx.

Can anybody please point me in the right direction on this problem?

Thanks ;)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月流歌 2025-01-04 22:56:07

这是解决方案:

<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>

Here is the solution:

<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>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文