【问题标题】:solr tika data import is not working properlysolr tika 数据导入无法正常工作
【发布时间】:2015-04-17 10:34:34
【问题描述】:

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

solrconfig.xml

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

Schema.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:\Users\vellianm\Documents\BBRC\SearchEngine\solr-5.0.0\example\exampledocs\Process_documents\6.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

【问题讨论】:

  • 转到 solr admin 然后登录。启用调试模式。再次运行导入器,您应该会看到更多信息。我希望这对你有更多帮助。
  • 谢谢ameertawfik。我已经启用并检查了,但是dataimporter没有错误。

标签: apache search solr apache-tika


【解决方案1】:

这对我有用:

<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>

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

【讨论】:

  • 从您的葡萄牙语原文中查看我的翻译。 (?) 如果需要进一步说明,您应该edit用英文回答
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-02
  • 2015-02-15
  • 1970-01-01
  • 1970-01-01
  • 2018-02-14
相关资源
最近更新 更多