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 manju16832003 <ma...@gmail.com> on 2014/02/24 10:15:17 UTC

URLDataSource : Issue assigning single xpath field name to two solr fields

I'm not sure if I would be missing any configuration params here, however
when I tried to assign an xpath field from URLDataSource (XML end point) to
two fields defined in schema.xml.

Here is my scenario,
I have two fields
*profile_display* and *profile_indexed*

My assignment in DataImpotHandler looks like this

<entity name="user" dataSource="crm"
                       
url="http://URLTOExternalSystem//ProfileService.svc/"
                        processor="XPathEntityProcessor"
                        forEach="/Profiles">
<field column="profile_display" xpath="/Profile/profile_name" />
<field column="profile_indexed" xpath="/Profile/profile_name" />
</entity>

My Scheama.xml config looks like this
<field name="profile_display" type="string" indexed="true" stored="true" 
multiValued="false" default=""/>
        <field name="profile_indexed" type="text_general" indexed="true"
stored="false"  multiValued="false" default=""/>

*So the issue here is, the value is value is always assigned to
profile_indexed, and profile_display does not contain any value. *

Meaning, if we were to assign xpath field name to different solr fields,
only the last field contains the data.

The reason I have two fields is that, One to store it as a String to display
to user, another field where I apply Filter and Tokenizers to do text
transformation.



--
View this message in context: http://lucene.472066.n3.nabble.com/URLDataSource-Issue-assigning-single-xpath-field-name-to-two-solr-fields-tp4119206.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: URLDataSource : Issue assigning single xpath field name to two solr fields

Posted by Gora Mohanty <go...@mimirtech.com>.
On 24 February 2014 14:45, manju16832003 <ma...@gmail.com> wrote:
> I'm not sure if I would be missing any configuration params here, however
> when I tried to assign an xpath field from URLDataSource (XML end point) to
> two fields defined in schema.xml.
>
> Here is my scenario,
> I have two fields
> *profile_display* and *profile_indexed*
>
> My assignment in DataImpotHandler looks like this
>
> <entity name="user" dataSource="crm"
>
> url="http://URLTOExternalSystem//ProfileService.svc/"
>                         processor="XPathEntityProcessor"
>                         forEach="/Profiles">
> <field column="profile_display" xpath="/Profile/profile_name" />
> <field column="profile_indexed" xpath="/Profile/profile_name" />
> </entity>
>
> My Scheama.xml config looks like this
> <field name="profile_display" type="string" indexed="true" stored="true"
> multiValued="false" default=""/>
>         <field name="profile_indexed" type="text_general" indexed="true"
> stored="false"  multiValued="false" default=""/>
>
> *So the issue here is, the value is value is always assigned to
> profile_indexed, and profile_display does not contain any value. *
>
> Meaning, if we were to assign xpath field name to different solr fields,
> only the last field contains the data.
>
> The reason I have two fields is that, One to store it as a String to display
> to user, another field where I apply Filter and Tokenizers to do text
> transformation.

Not sure what happens when the same Xpath is applied to two fields
(though I would have thought that this should work). If you need the
same data in two fields that are tokenised in different ways, you can
use Solr's CopyField: http://wiki.apache.org/solr/SchemaXml#Copy_Fields
This will be more efficient, too.

Regards,
Gora

Re: URLDataSource : Issue assigning single xpath field name to two solr fields

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
The XPathEntityProcessor supports only one field mapping per xpath so
using copyField is the only way.

On Mon, Feb 24, 2014 at 2:45 PM, manju16832003 <ma...@gmail.com> wrote:
> I'm not sure if I would be missing any configuration params here, however
> when I tried to assign an xpath field from URLDataSource (XML end point) to
> two fields defined in schema.xml.
>
> Here is my scenario,
> I have two fields
> *profile_display* and *profile_indexed*
>
> My assignment in DataImpotHandler looks like this
>
> <entity name="user" dataSource="crm"
>
> url="http://URLTOExternalSystem//ProfileService.svc/"
>                         processor="XPathEntityProcessor"
>                         forEach="/Profiles">
> <field column="profile_display" xpath="/Profile/profile_name" />
> <field column="profile_indexed" xpath="/Profile/profile_name" />
> </entity>
>
> My Scheama.xml config looks like this
> <field name="profile_display" type="string" indexed="true" stored="true"
> multiValued="false" default=""/>
>         <field name="profile_indexed" type="text_general" indexed="true"
> stored="false"  multiValued="false" default=""/>
>
> *So the issue here is, the value is value is always assigned to
> profile_indexed, and profile_display does not contain any value. *
>
> Meaning, if we were to assign xpath field name to different solr fields,
> only the last field contains the data.
>
> The reason I have two fields is that, One to store it as a String to display
> to user, another field where I apply Filter and Tokenizers to do text
> transformation.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/URLDataSource-Issue-assigning-single-xpath-field-name-to-two-solr-fields-tp4119206.html
> Sent from the Solr - User mailing list archive at Nabble.com.



-- 
Regards,
Shalin Shekhar Mangar.