> Thanks Mr.Yagami. I'll look into that.

Hi Bing,

You can this data-config.xml to index txt files on disk. Add these fields to 
schema.xml

<field name="link" type="string" indexed="true" stored="true" 
multiValued="false" required="true"/>
        
<field name="fileLastModified" type="string" indexed="true" stored="true" />
<field name="text" type="text" indexed="true" stored="true"  />

<uniqueKey>link</uniqueKey>

<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" name="fds"/>
    <document>
        <entity name="f" processor="FileListEntityProcessor" fileName=".*txt" 
baseDir="/Volumes/data/Documents" recursive="true" rootEntity="false" 
dataSource="null" >
        <!--The implicit fields generated by the FileListEntityProcessor are 
fileDir, file, fileAbsolutePath, fileSize, fileLastModified -->
         <field column="fileLastModified" name="fileLastModified" /> 
         <field column="fileAbsolutePath" name="link" />
         <entity processor="PlainTextEntityProcessor" name="x" 
url="${f.fileAbsolutePath}" dataSource="fds"  rootEntity="true">
           <!-- copies the text to a field called 'text' in Solr-->
          <field column="plainText" name="text"/>
          </entity>
        </entity>
    </document>
</dataConfig>

Reply via email to