Solr增量导入,多个数据库

时间:2019-05-27 12:31:26

标签: solr solr6 dih

我目前在solr中具有db_data_config设置,可以轻松地跨多个数据库执行完全导入。 我的配置与此类似:

<dataSource name="db1" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="database1"/>
<dataSource name="db2" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="database2"/>
<document name="items">
    <entity name="item" pk="id" query="select id,description from ItemTable" dataSource="db1">
        <field column="id" name="id"/>
        <field column="description" name="description"/>
        <entity name="itemprice" query="select price from PriceTable where id='${item.id}'" dataSource="db1">
             <field column="price" name="price_db1_f"/>
        </entity>
        <entity name="itemprice" query="select price from PriceTable where id='${item.id}'" dataSource="db2">
             <field column="price" name="price_db2_f"/>
        </entity>
        ... etc for 'x' amount of times.
    </entity>
</document>

这里的想法是,有一个主要的托管数据库,其中包含我们需要的所有信息,但是有多个数据库,每个项目的价格不同。

使用deltaImport捕获子实体数据库之一中的更改的最佳方法是什么?如果db2有价格变化,我想让我的delta在运行deltaImport时收取该变化。

0 个答案:

没有答案