Thanks, it is working fine but I had to change the following line <field name="id" template="${f.file}" />
to <field column="id" template="${f.file}" /> On Mon, Jun 9, 2014 at 9:29 AM, Shalin Shekhar Mangar [via Lucene] < ml-node+s472066n4140715...@n3.nabble.com> wrote: > 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 <[hidden email] > <http://user/SendEmail.jtp?type=node&node=4140715&i=0>> 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. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://lucene.472066.n3.nabble.com/Provide-value-to-uniqueID-tp4140712p4140715.html > To unsubscribe from Provide value to uniqueID, click here > <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4140712&code=aXNtYWVlbC5lbmpyZW55QGdtYWlsLmNvbXw0MTQwNzEyfC01NTkxMjYzODg=> > . > NAML > <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://lucene.472066.n3.nabble.com/Provide-value-to-uniqueID-tp4140712p4140725.html Sent from the Solr - User mailing list archive at Nabble.com.