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 Vishal Swaroop <vi...@gmail.com> on 2015/03/03 04:13:17 UTC
Re: Suggestion on indexing complex xml
Thanks for your time and suggestions Alex...
a) So, if I use xslt... then SOLR output result will be xml, or there is a
trick to get json also
b) I am trying to figure out xslt template for my xml (as below) input to
differentiate "parameter1" & "parameter2" as some elements are common (e.g.
name, value)... any help will be great.
Trying to figure out best approach for below xml.
c) Is there a way to get the attribute (e.g. version) also for element
(e.g. parameter)
*XML input :*
<?xml version="1.0" encoding="UTF-8"?>
<*build*>
<*actions*>
<*parametersAction*>
<*parameters*>
<*parameter1 *version="1.0">
<name>Name1</name>
<value>1</value>
</*parameter1*>
<*parameter2*>
<name>Name2</name>
<description>description test</description>
<value>2</value>
</*parameter2*>
</*parameters*>
</*parametersAction*>
</*actions*>
</*build*>
Regards
Vishal
On Fri, Feb 27, 2015 at 4:43 PM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:
> On 27 February 2015 at 16:11, Vishal Swaroop <vi...@gmail.com> wrote:
> > I am able to index XML with same "name" element but in different XPATH by
> > using XPathEntityProcessor "forEach" (e.g. below)
> >
> > Just wondering if there is better way to handle this xml format.
>
> DIH's XML parser is rather limited and literally-minded. You could
> instead pre-process XML with XSLT:
>
> https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-UsingXSLTtoTransformXMLIndexUpdates
>
> Or looking into something like SIREn:
> http://siren.solutions/siren/overview/
>
> Regards,
> Alex.
>
>
> ----
> Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
> http://www.solr-start.com/
>