SolR 的数据导入处理程序跟踪但忽略嵌套实体的更改

SolR's Data Import Handler tracks but ignores nested entity's changes

我有两个 table,我正在尝试让数据导入处理程序在子实体更改时更新文档的索引。当我触发“delta-import”命令时,我得到以下信息:

{
  "responseHeader":{
    "status":0,
    "QTime":3},
  "initArgs":[
    "defaults",[
      "config","db-data-config.xml"]],
  "command":"delta-import",
  "status":"idle",
  "importResponse":"",
  "statusMessages":{
    "Total Requests made to DataSource":"5",
    "Total Rows Fetched":"3",
    "Total Documents Processed":"0",
    "Total Documents Skipped":"0",
    "Delta Dump started":"2021-08-16 11:05:47",
    "Identifying Delta":"2021-08-16 11:05:47",
    "Deltas Obtained":"2021-08-16 11:05:47",
    "Building documents":"2021-08-16 11:05:47",
    "Total Changed Documents":"0",
    "Time taken":"0:0:0.12"}}

我的数据配置是这样的:

<dataConfig>
    <dataSource driver="org.mariadb.jdbc.Driver" url="jdbc:mysql://localhost:3306/eepyakm?user=root" user="root" password="root"/>
    <document>
        <entity name="supplier" query="select * from suppliers_tmp_view"
                deltaQuery="select id from suppliers_tmp_view where last_modified > '${dataimporter.last_index_time}'"
                deltaImportQuery="select * from suppliers_tmp_view where id='${dataimporter.delta.id}'">
                
                
            <entity name="attachment"  
                    query="select * from suppliers_tmp_files_view where supplier_tmp_id='${supplier.id}'"
                    deltaQuery="select id from suppliers_tmp_files_view where last_modified > '${dataimporter.last_index_time}'"
                    parentDeltaQuery="select id from suppliers_tmp_view where id='${attachment.supplier_tmp_id}'">
                <field name="path" column="path" />
            </entity>
            
        </entity>
    </document>
</dataConfig>

据我了解,“Total Rows Fetched”显示子实体 table 中的 3 个条目已更改。那么,为什么它不索引更改的字段?

如果我执行“完全导入”,它会很好地选择更改。

您的两个查询都不包含 supplier_tmp_id - 但您仍然在 parentDeltaQuery 中引用了它。

您还想 select 此列并在您的 SELECT 声明中。