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 Evgeniy Strokin <ev...@yahoo.com> on 2008/01/11 16:44:59 UTC

Documents with One-to-many

Hello. If I need documents which has number of fields but also I have number of other documents which related to the first one one-to-many. For example a person, could have several addresses. I want to have all of them in search result if I look for people. Also I want to search people by address.
How it could be done in Solr?
 
Thank you
Gene

Re: Documents with One-to-many

Posted by Stuart Sierra <ma...@stuartsierra.com>.
On Jan 11, 2008 10:44 AM, Evgeniy Strokin <ev...@yahoo.com> wrote:
> Hello. If I need documents which has number of fields but also I have number of other documents which related to the first one one-to-many. For example a person, could have several addresses. I want to have all of them in search result if I look for people. Also I want to search people by address.
> How it could be done in Solr?

It may be easier to perform this type of query in a relational
database.  With Solr, I think you would have to copy all of the "many"
fields into a single field in your "one" document.  So, a "person"
document would have a single "address" field containing all the
addresses for that person.

-Stuart
altlaw.org