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 meghana <me...@amultek.com> on 2012/01/05 15:37:28 UTC

XPathEntityProcessor append text in foreach

Hi all, 

i have one non-multivalued field , which i want to import from a file using
XPathEntityProcessor.

 <entity name="x" onError="continue"  processor="XPathEntityProcessor"
transformer="TemplateTransformer" forEach="/tt/body/div/p"
url="${SRC.FileName}" dataSource="FS">
                       <field column="Mfld" xpath="/xa/xb"/>
               </entity>

it works for fine for multi-valued field but , for signle value field it
just assign one value of that. can i append text of  '/xa/xb' in 'Mfld'? 

Thanks 
Meghana

--
View this message in context: http://lucene.472066.n3.nabble.com/XPathEntityProcessor-append-text-in-foreach-tp3635022p3635022.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: XPathEntityProcessor append text in foreach

Posted by Erick Erickson <er...@gmail.com>.
I think you would get much farther along if
you thought about a SolrJ program that
read in the documents, parsed them
and then constructed the Solr document to
send to Solr. This is much more
flexible than trying to force complex
manipulations through XPathEntityProcessor,
which does not support the full
XPath syntax.

Best
Erick

On Fri, Jan 6, 2012 at 4:15 AM, meghana <me...@amultek.com> wrote:
>
> I have String like below format
> -------------------------------
> <xa><xb impt="12">this is solr!!</xb><xb impt="18">Welcome</xb><xb
> impt="35">Hello test</xb></xa>
>
> I want it to convert it in below format using XPathEntityProcessor
> -------------------------------
> 12: this is solr!! 18: Welcome 35: Hello test
>
> I had used PlainTextEnityProcessor with ScriptTransformer to make string
> like above... but it encode some text , So i want it to make happen using
> XPathEntityProcessor.
>
> Can anybody have any idea , how to do that?
> Thanks
> Meghana
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/XPathEntityProcessor-append-text-in-foreach-tp3635022p3637412.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: XPathEntityProcessor append text in foreach

Posted by meghana <me...@amultek.com>.
I have String like below format
------------------------------- 
<xa><xb impt="12">this is solr!!</xb><xb impt="18">Welcome</xb><xb
impt="35">Hello test</xb></xa>

I want it to convert it in below format using XPathEntityProcessor
-------------------------------
12: this is solr!! 18: Welcome 35: Hello test

I had used PlainTextEnityProcessor with ScriptTransformer to make string
like above... but it encode some text , So i want it to make happen using
XPathEntityProcessor.

Can anybody have any idea , how to do that?
Thanks
Meghana

--
View this message in context: http://lucene.472066.n3.nabble.com/XPathEntityProcessor-append-text-in-foreach-tp3635022p3637412.html
Sent from the Solr - User mailing list archive at Nabble.com.