lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Newman <newman...@gmail.com>
Subject Re: DIH - importing XML with nested elements that have the same name
Date Wed, 26 Sep 2012 18:17:21 GMT
To be a little more specific, the error message I get is:
"forEach cannot start with '//'"

Cannot really find anything on this except for
https://issues.apache.org/jira/browse/SOLR-1437.  Which only talks
about using '//' for the xpath attribute in the field tag, nothing
about using '//' in a forEach attribute.

Any suggestions?

Thanks,
Billy

On Wed, Sep 26, 2012 at 10:59 AM, Billy Newman <newmanw10@gmail.com> wrote:
> Hello all,
>
> I am running solr 4.0.0-BETA and I am running into an issue when
> trying to import an XML document in which I want forEach to pull from
> nested elements with the same element name.
>
> doc example:
>         <test>
>           <item>
>             <id>1</id>
>             <name>Item 1</name>
>           </item>
>           <item>
>             <id>2</id>
>             <name>Item 2</name>
>              <item>
>                 <id>3</id>
>                 <name>Item 3</name>
>                  <item>
>                   <id>4</id>
>                   <name>Item 4</name>
>                </item>
>              </item>
>           </item>
>         </test>
>
> Where each item can contain 'n' number of items.
>
> forEach="/test/item", will get get item 1 and 2 but not 3 or 4.  I
> cannot really use an "|" in this case as I cannot define this for
> infinite levels.
>
> In XPath I think typically you would use something like "//item"  to
> get all item elements.  But I think I am hitting limitations with
> solr's XPath implementation as from my reading it seems like only full
> path is implemented with no wild cards.
>
> Has anyone else found a good solution to this issue?
>
> Is it possible to use Java's implementation of XPath to do things like "//item"?
>
> Thanks in advance!
> Billy

Mime
View raw message