【问题标题】:solr import files from multiple dataSource entitysolr 从多个数据源实体导入文件
【发布时间】:2015-08-27 11:11:56
【问题描述】:

我正在尝试从多个文件夹导入文件。

我的solrconfig.xml 调用以下文件以将其与org.apache.solr.handler.dataimport.DataImportHandler 一起使用。

<dataConfig>  
    <dataSource type="BinFileDataSource" />
        <document>
            <entity name="files1"
                    dataSource="null"
                    rootEntity="false"
                    processor="FileListEntityProcessor"
                    baseDir="/w/PDF/"
                    fileName=".*\.(pdf)|(doc)|(docx)|(ppt)|(pptx)|(xls)|(xlsx)|(odf)|(txt)|(rtf)|(html)|(htm)|(jpg)"
                    onError="skip"
                    recursive="true">

                <field column="fileAbsolutePath" name="id" />
                <field column="fileSize" name="size" />
                <field column="fileLastModified" name="lastModified" />
                <field column="file" name="fileName"/>

                <entity
                    name="documentImport1"
                    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"/>
                    <copyField source="content" dest="text"/>

                </entity>
            </entity>

            <entity name="files2"
                    dataSource="null"
                    rootEntity="false"
                    processor="FileListEntityProcessor"
                    baseDir="/w/KNOW-HOW/"
                    fileName=".*\.(pdf)|(doc)|(docx)|(ppt)|(pptx)|(xls)|(xlsx)|(odf)|(txt)|(rtf)|(html)|(htm)|(jpg)"
                    onError="skip"
                    recursive="true">

                <field column="fileAbsolutePath" name="id" />
                <field column="fileSize" name="size" />
                <field column="fileLastModified" name="lastModified" />
                <field column="file" name="fileName"/>

                <entity
                    name="documentImport2"
                    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"/>
                    <copyField source="content" dest="text"/>

                </entity>
            </entity>
        </document> 
</dataConfig>  

在导入过程中,我得到一个FileNotFoundException。

我错过了什么?

【问题讨论】:

    标签: solr data-import


    【解决方案1】:

    只需将第二个实体中的代码更改为:${files.fileAbsolutePath} 到 ${files2.fileAbsolutePath}。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多