lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: Converting nested data model to solr schema
Date Mon, 01 Jul 2013 14:07:57 GMT
Simply duplicate a subset of the fields that you want to query of the parent 
document on each child document and then you can directly query the child 
documents without any join.

Yes, given the complexity of your data, a two-step query process may be 
necessary for some queries - do one query to get parent or child IDs and 
then do a second query filtered by those IDs.

And, yes, this only approximates the full power of an SQL join - but at a 
tiny fraction of the cost.

-- Jack Krupansky

-----Original Message----- 
From: adfel70
Sent: Monday, July 01, 2013 9:56 AM
Subject: Converting nested data model to solr schema

I have the following data model:
1. Document (fields: doc_id, author, content)
2. Each Document has multiple  attachment types. Each attachment type has
multiple instances. And each attachment type may have different fields.
for example:
   <content>some long long text...</content>

I want to index all this data in solr cloud.
My current solution is to index the original document by its self and index
each attachment as a single solr document with its parent_doc_id, and then
use solr join capability.
The problem with this solution is  that I must index all the attachments of
each document, and the document itself in the same shard (current solr
This requires me to override the solr document distribution mechanism.
I fear that with this solution I may loose some of solr cloud's
My questions are:
1. Are my concerns regarding downside of overriding solr cloud's
out-of-the-box mechanism justified? Or should I proceed with this solution?
2. If I'm looking for another solution, can I  somehow keep all attachments
on the same document and be able to query on a single attachment?
A query example:
Retrieve  all documents where:
content: contains "abc"
AND = 'Bob'
AND = '12-12-2012'


View this message in context:
Sent from the Solr - User mailing list archive at 

View raw message