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 "vrparekh@gmail.com" <vr...@gmail.com> on 2012/01/06 15:15:41 UTC
xpathentityprocessor with flattern true
Hello all,
i want to get whole xmldata into one field, for that i am using
xpathentityprocessor with flattern=true
but still it doesn't work as expected.
e.g. sample xml is <root><doc>abc</doc><part><id>abc</id>
<id>bcd</id>
<id>def</id>
</part></root>
main part i want is i want all "id" nodes into single field
<entity name="x" onError="abort" processor="XPathEntityProcessor"
flatten="true" forEach="/root/part/id" url="${myfilepath}" dataSource="FD">
<field column="CommonIDs" xpath="/root/part/id" />
</entity>
CommonIDs is single valued field, should contain "<id>abc</id>
<id>bcd</id>
<id>def</id>" if it takes root node also it will also fine for me.
please help me to solve this problem,
Thanks
Vishal Parekh
--
View this message in context: http://lucene.472066.n3.nabble.com/xpathentityprocessor-with-flattern-true-tp3637928p3637928.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: xpathentityprocessor with flattern true
Posted by Rakesh Varna <ra...@gmail.com>.
Try using flatten="true" in the <field> rather than the <entity>. Note that
it will remove all child node names, and will only concatenate the text
values of the child nodes.
example:
<root>
<part>
<id>abc</id>
<id>def</id>
<id>ghi>/id>
<field column="CommonIDs" xpath="/root/part" flatten="true" />
will concatenate abc, def, ghi to give a single text value. Note that xpath
terminates at <part>
Regards,
Rakesh Varna
On Mon, Jan 9, 2012 at 8:32 AM, vrparekh@gmail.com <vr...@gmail.com>wrote:
> am i making any mistake with xpathentityprocessor?
>
> i am using solr 1.4
>
> please help me to solve this problem?
>
>
>
> Thanks & Regards,
> Vishal Parekh
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/xpathentityprocessor-with-flattern-true-tp3637928p3645013.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Re: xpathentityprocessor with flattern true
Posted by "vrparekh@gmail.com" <vr...@gmail.com>.
am i making any mistake with xpathentityprocessor?
i am using solr 1.4
please help me to solve this problem?
Thanks & Regards,
Vishal Parekh
--
View this message in context: http://lucene.472066.n3.nabble.com/xpathentityprocessor-with-flattern-true-tp3637928p3645013.html
Sent from the Solr - User mailing list archive at Nabble.com.