lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishal Swaroop <vishal....@gmail.com>
Subject Re: Suggestion on indexing complex xml
Date Tue, 03 Mar 2015 03:13:17 GMT
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 <arafalov@gmail.com>
wrote:

> On 27 February 2015 at 16:11, Vishal Swaroop <vishal.rec@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/
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message