Solr的DataImportHandler不索引一切

问题描述

我也在尝试更新旧的Solr实例,该实例用于在文件服务器上搜索诸如Pdf的文档之类的文档。至少有100.000个文件。我复制了大多数配置并替换了过时的内容。数据被索引为Corret,但仅类似于1800个文档。我不知道我的问题在哪里。我从日志中仅收到一些警告,例如:由于字体等而导致NoUnicodeMapping。

我像这样在我的Solrconfig中初始化了DIH:

<requestHandler name="/dataimport" class="solr.dataimporthandler">
<lst name="defaults">
  <str name="config">deron-data-config.xml</str>
  
</lst>

我的模式如下:

 <field name="id" multiValued="false" required="true" stored="true" indexed="true" type="string"/>
   <field name="fileName" stored="true" indexed="true" type="string"/>
   <field name="author" stored="true" indexed="true" type="string"/>
   <field name="title" stored="true" indexed="true" type="string"/>
   <field name="size" stored="true" indexed="true" type="long"/>
   <field name="lastModified" stored="true" indexed="true" type="tdate"/>
   <field name="fileAbsolutePathWindows" stored="true" indexed="true" type="string"/>
   <field name="fileExtension" stored="true" indexed="true" type="string"/>
   <field name="fileDevice" stored="true" indexed="true" type="string"/>
   <field name="text" multiValued="true" stored="true" indexed="true" type="text_general"/>

   <copyField source="fileAbsolutePathWindows" dest="text"/>
   <copyField source="fileExtension" dest="text"/>
   <copyField source="fileName" dest="text"/>
   <copyField source="author" dest="text"/>
   <copyField source="title" dest="text"/>  

我的数据导入配置是这样的:

<dataConfig> 
<dataSource name="bin" type="BinFileDataSource" encoding="UTF-8" />
    <document>     

        <!-- device K -->

        <entity name="K-smallerThan50mb" dataSource="null" rootEntity="false"
        processor="FileListEntityProcessor"
        baseDir="/home/solr/K/"
        fileName="/^[^.]+$|\.(?!(dll|bat|7z|bak|bz2|dmp|exe|gz|img|iso|ova|rar|tmp|trc|ttf|vhd|vmdk|vmem|vmsn|vmss|zip)$)([^.]+$)"
        onError="skip"
        transformer="LogTransformer,RegexTransformer,TemplateTransformer"
        logLevel="info"
        smallerThan="52428800"
      
        recursive="true">
            <field column="fileAbsolutePath" name="id" />
            <field column="fileSize" name="size" />
            <field column="fileLastModified" name="lastModified" />
            <field column="file" name="fileName" />

            <field column="fileAbsolutePathWindowsPrepare" sourceColName="fileAbsolutePath" regex="/home/solr/(.)(.*)" replaceWith="$1:$2"/>
            <field column="fileAbsolutePathWindows" sourceColName="fileAbsolutePathWindowsPrepare" regex="/" replaceWith="\\"/>
            <field column="fileAbsolutePathWindows" name="fileAbsolutePathWindows"/>
            
            <field column="fileExtension" sourceColName="file" regex=".*\.(.*)" replaceWith="$1"/>
            <field column="fileExtension" name="fileExtension"/>   
            
            <field column="fileDevice" sourceColName="fileAbsolutePath" regex="/home/solr/./(.*?)/.*" replaceWith="$1"/>
            <entity
                name="documentImport" dataSource="bin"
                processor="TikaEntityProcessor"
                url="${K-smallerThan50mb.fileAbsolutePath}"
                format="text" onError="continue">
                <field column="Author" name="author" Meta="true"/>
                <field column="title" name="title" Meta="true"/>
                <field column="text" name="text"/>
            </entity>
        </entity>

        <entity name="K-biggerThan50mb" dataSource="null" rootEntity="false"
        processor="FileListEntityProcessor"
        baseDir="/home/solr/K/"
        fileName=".*\.(doc|docx|xls|xlsx|ppt|pptx|pdf)$"
        onError="continue"
        transformer="LogTransformer,TemplateTransformer"
        logLevel="info"
        biggerThan="52428800"
        
        recursive="true">
            <field column="fileAbsolutePath" name="id" />
            <field column="fileSize" name="size" />
            <field column="fileLastModified" name="lastModified" />
            <field column="file" name="fileName" />

            <field column="fileAbsolutePathWindowsPrepare" sourceColName="fileAbsolutePath" regex="/home/solr/(.)(.*)" replaceWith="$1:$2"/>
            <field column="fileAbsolutePathWindows" sourceColName="fileAbsolutePathWindowsPrepare" regex="/" replaceWith="\\"/>
            <field column="fileAbsolutePathWindows" name="fileAbsolutePathWindows"/>

            <field column="fileExtension" sourceColName="file" regex=".*\.(.*)" replaceWith="$1"/>
            <field column="fileExtension" name="fileExtension"/>

            <field column="fileDevice" sourceColName="fileAbsolutePath" regex="/home/solr/./(.*?)/.*" replaceWith="$1"/>
            <entity
                name="documentImport" dataSource="bin"
                processor="TikaEntityProcessor"
                url="${K-biggerThan50mb.fileAbsolutePath}"
                format="text" onError="skip">
                <field column="Author" name="author" Meta="true"/>
                <field column="title" name="title" Meta="true"/>
                <field column="text" name="text"/>
            </entity>
        </entity>   
        
        <entity name="K-zip" dataSource="null" rootEntity="true"
        processor="FileListEntityProcessor"
        baseDir="/home/solr/K/"
        fileName=".*\.(zip)$"
        onError="skip"
   
        transformer="LogTransformer,TemplateTransformer"
        logLevel="info"
        
        recursive="true">
            <field column="fileAbsolutePath" name="id" />
            <field column="fileSize" name="size" />
            <field column="fileLastModified" name="lastModified" />
            <field column="file" name="fileName" />

            <field column="fileAbsolutePathWindowsPrepare" sourceColName="fileAbsolutePath" regex="/home/solr/(.)(.*)" replaceWith="$1:$2"/>
            <field column="fileAbsolutePathWindows" sourceColName="fileAbsolutePathWindowsPrepare" regex="/" replaceWith="\\"/>
            <field column="fileAbsolutePathWindows" name="fileAbsolutePathWindows"/>

            <field column="fileExtension" sourceColName="file" regex=".*\.(.*)" replaceWith="$1"/>
            <field column="fileExtension" name="fileExtension"/>
            
            <field column="fileDevice" sourceColName="fileAbsolutePath" regex="/home/solr/./(.*?)/.*" replaceWith="$1"/>
        </entity>

        <!-- end device K -->
    
    </document>

这些设置适用于旧实例,但现在不起作用。 有谁可以帮助我解决这个问题? 如果是,非常感谢。自几周以来,我一直在处理该问题。

干杯, 莱文

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)