You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by solr <la...@gmail.com> on 2012/01/19 13:26:05 UTC
How to import data from xml files to solr
How to import data from xml files to solr.
is this is the right command java -jar post.jar sample.xmljava -jar
post.jar solr.xml monitor.xml
Or any other process to import data from xml files
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-import-data-from-xml-files-to-solr-tp3672193p3672193.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to import data from xml files to solr
Posted by Jan Høydahl <ja...@cominvent.com>.
Hi,
Note that there is yet another option, the XSLT UpdateRequestHandler http://wiki.apache.org/solr/XsltUpdateRequestHandler (which obviously needs better documentation).
It can take arbirarty XML in, along with a stylesheet for transformation, and voila :)
I made a stylesheet to import search result XML through XSLT update handler. See http://dl.dropbox.com/u/20080302/updateXml.xsl
The curl command is:
curl "http://localhost:8983/solr/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml; charset=utf-8" --data-binary @searchres.xml
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com
On 20. jan. 2012, at 07:18, Gora Mohanty wrote:
> On Fri, Jan 20, 2012 at 11:00 AM, solr <la...@gmail.com> wrote:
>> Is indexing xml files and import data from xml is same or different in solr
>> concept.
>
> They end up doing the same thing, which is getting the data into Solr.
>
> There are various ways of doing this, as Erick has pointed out, and
> sometimes people name the process in different ways:
> * Importing data from XML is usually understood to be done by POSTing
> a Solr-format XML file to data.
> * Indexing XML files could be understood as using some external
> program, such as SolrJ, or the DataImportHandler, to get the
> XML data into Solr.
>
> Regards,
> Gora
Re: How to import data from xml files to solr
Posted by Gora Mohanty <go...@mimirtech.com>.
On Fri, Jan 20, 2012 at 11:00 AM, solr <la...@gmail.com> wrote:
> Is indexing xml files and import data from xml is same or different in solr
> concept.
They end up doing the same thing, which is getting the data into Solr.
There are various ways of doing this, as Erick has pointed out, and
sometimes people name the process in different ways:
* Importing data from XML is usually understood to be done by POSTing
a Solr-format XML file to data.
* Indexing XML files could be understood as using some external
program, such as SolrJ, or the DataImportHandler, to get the
XML data into Solr.
Regards,
Gora
Re: How to import data from xml files to solr
Posted by solr <la...@gmail.com>.
Is indexing xml files and import data from xml is same or different in solr
concept.
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-import-data-from-xml-files-to-solr-tp3672193p3674641.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to import data from xml files to solr
Posted by Erick Erickson <er...@gmail.com>.
You cannot directly import arbitrary XML. You'd have to
read it into a program (look at SolrJ), parse and add it
to SolrInputDocuments and send to Solr.
Alternately, you could read the XML and transform it
to "solr friendly" XML and then index those files.
A third possibility is to use the Data Import Handler
and use the XSLTransformer..
Best
Erick
On Thu, Jan 19, 2012 at 10:54 AM, solr <la...@gmail.com> wrote:
> Hi gora,
> thanks for your reply.am new to solr .I have been check solr tutorial.and
> noticed example xmlfiles exampledcos folder in solr distribution.
> 1.here indexing means importdata into solr?
> If i want to start new example insted in solrdistribution.How to proceed.
> Am bit confusing about solr concept.Especially about index xml data and
> import xmldata.Both are same or diffrent if so please tell me if we have to
> import xmdat aand steps to do and xmlformat
> Anyhelp would be appriciate
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-import-data-from-xml-files-to-solr-tp3672193p3673284.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to import data from xml files to solr
Posted by solr <la...@gmail.com>.
Hi gora,
thanks for your reply.am new to solr .I have been check solr tutorial.and
noticed example xmlfiles exampledcos folder in solr distribution.
1.here indexing means importdata into solr?
If i want to start new example insted in solrdistribution.How to proceed.
Am bit confusing about solr concept.Especially about index xml data and
import xmldata.Both are same or diffrent if so please tell me if we have to
import xmdat aand steps to do and xmlformat
Anyhelp would be appriciate
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-import-data-from-xml-files-to-solr-tp3672193p3673284.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to import data from xml files to solr
Posted by Gora Mohanty <go...@mimirtech.com>.
On Thu, Jan 19, 2012 at 5:56 PM, solr <la...@gmail.com> wrote:
> How to import data from xml files to solr.
> is this is the right command java -jar post.jar sample.xml
[...]
This should work, but please take a look at the format of
the sample XML files: Solr expects a specific format for
the XML files being POSTed.
Regards,
Gora