DataImportHandler and partial updates

2019-07-18 17:12发布

问题:

Is that possible to use DataImportHandler with partial updates in Solr 4? Should I be able to use a data-config.xml like the one below, and import both entities in separate moments and get full documents with both data?

<document name="item">
    <entity name="pricing" query="select * from prc">
        <field column="ID" name="itemId" />
        <field column="NM" name="itemName" />
        <field column="default" name="defaultPrice" />
        <field column="sale" name="salesPrice" />
    </entity>
    <entity name="tag" query="select * from tag">
        <field column="ID" name="itemId" />
        <field column="TAG" name="adminTag" />
    </entity> 
</document>

回答1:

Solr Partial update is not support for DIH. So you would probably need to use Solrj for this.
Also, for multiple entities you can have them specific.
However, these multiple entities would be indexed as seperate Documents in the Solr index and not as a combined document. If you want to single document, you would need to have a sub entity.