Solr doesn't explicitly support such relationships as its document model is flat.
It would seem reasonable to index your users and posts into the same index, but making sure your field names don't overlap. That is, your users might have a field 'name', and your posts have a field 'owner' and another 'content'. That way, you could search for: q=name:foo content:foo would find you any users who's name contains the term foo, and any posts who's content contains the term foo. Why would you want to 'define' a relationship? How would that help you? You can use pseudo-joins in 4.0 to do queries such as 'find me all users who have a post which mentions foo', or 'find me all posts by all users who joined last year'. Upayavira On Sun, Feb 3, 2013, at 03:14 PM, zagros wrote: > Hi, > > I'm new to Solr and have two questions. > > #1) > I was wondering if I wanted to index different object types. How I go > about > configuring them in schema file. > Here is the hypothetical simple scenario. My site has Users and Posts. > I > want to be able to index User objects, and Posts, but make it so that if > I > search "foo", then it searches Users with name "foo" and posts that have > "foo" in their text. > > #2) > Same scenario as above, I want to be able to define "Posts" to be child > of > "Users". Can't find any docs on how to do this > > > thanks in advance > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Beginner-Question-about-Types-and-Parent-Child-Definitions-in-Solr-Schema-xml-tp4038209.html > Sent from the Solr - User mailing list archive at Nabble.com.