Solr Tika 数据导入无法正常工作



当我进行数据导入时,它只索引一个文档,即使我在文件夹中有很多文件。

索尔配置.xml

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

架构.xml

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

tika-data-config.xml

<dataConfig>
    <dataSource type="BinFileDataSource" />
    <document>
            <entity name="files" dataSource="null" rootEntity="false"
            processor="FileListEntityProcessor"
            baseDir="C:UsersvellianmDocumentsBBRCSearchEnginesolr-5.0.0exampleexampledocsProcess_documents6.SCIM" fileName=".*.(pdf)|(PDF)"
            onError="skip"
            recursive="true">
                <field column="fileAbsolutePath" name="id" />
                <field column="fileSize" name="size" />
                <field column="fileLastModified" name="lastModified" />
                <entity
                    name="documentImport"
                    processor="TikaEntityProcessor"
                    url="${files.fileAbsolutePath}"
                    format="text">
                    <field column="file" name="fileName"/>
                    <field column="Author" name="author" meta="true"/>
                    <field column="title" name="title" meta="true"/>
                    <field column="text" name="text"/>
                </entity>
        </entity>
    </document>
</dataConfig>

当我单击数据导入时,我收到如下所述的成功消息。

上次更新时间:15:56:02 索引编制完成。添加/更新:1 个文档。 已删除 0 个文档。请求: 0, 已提取: 33, 已跳过: 0, 已处理: 1 开始:大约 6 小时前

这里获取的文档是 33 个,但处理的文档只有一个。此外,我在日志文件中找不到任何错误。

INFO  - 2015-04-17 09:53:48.957; org.apache.solr.handler.dataimport.DataImporter; Starting Full Import
INFO  - 2015-04-17 09:53:48.959; org.apache.solr.core.SolrCore; [tika] webapp=/solr path=/dataimport params={indent=true&command=status&_=1429264428957&wt=json} status=0 QTime=0 
INFO  - 2015-04-17 09:53:48.962; org.apache.solr.handler.dataimport.SimplePropertiesWriter; Read dataimport.properties
INFO  - 2015-04-17 09:53:48.978; org.apache.solr.update.DirectUpdateHandler2; [tika] REMOVING ALL DOCUMENTS FROM INDEX
INFO  - 2015-04-17 09:53:49.124; org.apache.solr.handler.dataimport.DocBuilder; Import completed successfully
这对

我有用:

<dataConfig>  
<dataSource type="BinFileDataSource" />
    <document>
        <entity name="files" dataSource="null" rootEntity="false"
        processor="FileListEntityProcessor"                     
        baseDir="/tmp/docs"
        fileName=".*.(DOC)|(PDF)|(pdf)|(doc)|(docx)|(ppt)"
        onError="skip"
        recursive="true">
            <field column="fileAbsolutePath" name="path" />
            <field column="fileSize" name="size" />
            <field column="fileLastModified" name="lastModified" />
            <entity
                name="documentImport"
                processor="TikaEntityProcessor"
                url="${files.fileAbsolutePath}"
                format="text">
                <field column="file" name="fileName"/>
                <field column="Author" name="author" meta="true"/>
                <field column="title" name="title" meta="true"/>
                <field column="text" name="text"/>
                <field column="fileAbsolutePath" name="path" />
                <field column="fileSize" name="size" />
                <field column="fileLastModified" name="lastmodified" />                    
                <field column="LastModifiedBy" name="LastModifiedBy" meta="true"/>
            </entity>
    </entity>
    </document> 
</dataConfig>

注意基线目录...引号是相反

最新更新