Solr 更新处理器链不影响通过dataimporthandler中的子实体加载的文档

Solr 更新处理器链不影响通过dataimporthandler中的子实体加载的文档,solr,parent-child,dataimporthandler,Solr,Parent Child,Dataimporthandler,我试图将大量数据(>10m记录)加载到SOLR中 我希望根据某些列值分割查询,并避免在多个实体中使用不同的where子句重复查询。所以我决定使用DIH的能力来嵌套实体 除了子实体中填充的字段不受UpdateProcessorChain中定义的处理器工厂的影响之外,所有操作都按预期进行。仅更新父实体中的那些字段。 我的数据配置文件 <entity name="nationalSearchResults" onError="skip" query="select distinct zi

我试图将大量数据(>10m记录)加载到SOLR中

我希望根据某些列值分割查询,并避免在多个实体中使用不同的where子句重复查询。所以我决定使用DIH的能力来嵌套实体

除了子实体中填充的字段不受UpdateProcessorChain中定义的处理器工厂的影响之外,所有操作都按预期进行。仅更新父实体中的那些字段。 我的数据配置文件

    <entity name="nationalSearchResults" onError="skip"
query="select distinct zip, state, city
        from table.location 
        where  transformer="RegexTransformer">
        <field column="ZIP" name="id"/>
        <field column="STATE" name="state"/>
        <field column="CITY" name="city"/>
    <entity child="true" name="nationalSearchResultsByState" onError="skip"
    query="SELECT b.zip, c.lctn_id, c.restaurants, c.pubs, c.coffeeshops, c.cinemas
        from table.location b
        join table.business c on c.zip = b.zip"
        transformer="script:searchResultsTransformer, RegexTransformer">
        <field column="LCTN_ID" name="id"/>
        <field column="RESTAURANTS" name="restaurants"/>
        <field column="PUBS" name="pubs"/>
        <field column="COFFEESHOPS" name="coffeeshops"/>
        <field column="CINEMAS" name="cinemas"/>
        <field column="ZIP" name="zip"/>
    </entity>
</entity>
  <updateRequestProcessorChain name="updateOnCommit">
<processor class="DistributedUpdateProcessorFactory"/>

<processor class="TrimFieldUpdateProcessorFactory" /> 
<processor class="RemoveBlankFieldUpdateProcessorFactory" />

<!-- To remove duplicate values in a multivalued field-->
<processor class="UniqFieldsUpdateProcessorFactory">
        <str name="fieldRegex">restaurant*</str>
        <str name="fieldRegex">pub*</str>
        <str name="fieldRegex">cinema*</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" /> <!-- Necessary. Unless explicitly executing update commands in an alternative custom !UpdateRequestProcessorFactory -->

Solr的URP链目前不影响嵌套文档中的子实体。看


请随意将您的用例添加到JIRA中,作为您需要它的示例,并在它得到修复时得到通知。

我已将用例添加到JIRA项目中作为注释。我将保留此问题,并在引入解决方案后关闭它。
<requestHandler name="/dataimport" class="DataImportHandler">
<lst name="defaults">
    <str name="config">data-config.xml</str>
    <str name="update.chain">updateOnCommit</str>
</lst>