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 scott chu <sc...@udngroup.com> on 2010/03/26 03:34:15 UTC
How can I do this in Solr?
I have a input xml data file & it has a 'Reporters' tag looks like this:
<StaffGroup>
<Staff>
<name>AAA</name>
<title>manager</title>
</Staff>
<Staff>
<name>BBB</name>
<title>coordinator</title>
</Staff>
</StaffGroup>
You see name & title are paired. As I know, Solr only support a field with mutliple value of primitive type, e.g. string. But in my case, it's a field with mutiple value of another paired name-title values. How can I configure Solr to deal with this case?
Best Regards,
Scott Chu
Re: How can I do this in Solr?
Posted by Lance Norskog <go...@gmail.com>.
You can create a field 'staff' with field values AAA_manager and
BBB_coordinator. This preserves the database relationship.
In general, think of a Solr index as one database table: you have to
flatten (denormalize) a standard database schema.
2010/3/25 scott chu <sc...@udngroup.com>:
> I have a input xml data file & it has a 'Reporters' tag looks like this:
>
> <StaffGroup>
> <Staff>
> <name>AAA</name>
> <title>manager</title>
> </Staff>
> <Staff>
> <name>BBB</name>
> <title>coordinator</title>
> </Staff>
> </StaffGroup>
>
> You see name & title are paired. As I know, Solr only support a field with mutliple value of primitive type, e.g. string. But in my case, it's a field with mutiple value of another paired name-title values. How can I configure Solr to deal with this case?
>
> Best Regards,
>
> Scott Chu
>
--
Lance Norskog
goksron@gmail.com