How can I do this in Solr?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I do this in Solr?

scott.chu
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
Reply | Threaded
Open this post in threaded view
|

Re: How can I do this in Solr?

Lance Norskog-2
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 <[hidden email]>:

> 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
[hidden email]