You can specify the file name as the id by adding a TemplateTransformer on
the entity "x" and specifying ${f.file} as the template value in the "id"
field. For example:

<dataSource type="FileDataSource" />

  <document>
    <entity name="f" processor="FileListEntityProcessor"
baseDir="F:\Work\Lucene\Solr\Solr Arabic Book" fileName=".txt"
recursive="true" rootEntity="false">
      <entity name="x" processor="LineEntityProcessor"
url="${f.fileAbsolutePath}" transformer="TemplateTransformer">
        <field column="rawLine" name="category_name" />
        <field name="id" template="${f.file}" />
      </entity>
    </entity>
  </document>




On Mon, Jun 9, 2014 at 11:23 AM, ienjreny <ismaeel.enjr...@gmail.com> wrote:

> Hello,
>
> I am using the following code to read text files
>
> <dataSource type="FileDataSource" />
>
>   <document>
>     <entity name="f" processor="FileListEntityProcessor"
> baseDir="F:\Work\Lucene\Solr\Solr Arabic Book" fileName=".txt"
> recursive="true" rootEntity="false">
>       <entity name="x" processor="LineEntityProcessor"
> url="${f.fileAbsolutePath}">
>         <field column="rawLine" name="category_name" />
>         <field column="???" name="id" />
>       </entity>
>     </entity>
>   </document>
>
> it is working perfect except the id value, how can I use file name (or any
> value) as value for uniqeuID field
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Provide-value-to-uniqueID-tp4140712.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to