lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dusausoy <>
Subject Database denormalization
Date Thu, 10 Jan 2013 13:34:36 GMT

I'm quite new with Solr.
I've searched for this but found no answer to my needs, which seems to 
be quite common though.

Let's say I have three entities in my database (I have more than that 
but it's for the sake of simplicity) :

File *------* Procedure *------* Organ
      1      n           1      m

All three entities only contain an id (let's say "file_ref", 
"procedure_ref" and "organ_ref") which are indexed and stored strings.

I'd like to be able to retrieve documents containing all three fields - 
obviously since they are stored.
But if I query for everything ("*:*") I don't get (file count)*n*m 
documents, only (file count) documents.

I'm using this kind of SQL query to import the data :

   <!-- ... -->
   <document name="files">
     <entity name="file" pk="file_id" query="select file_ref as file_id 
from file">
       <field column="file_id" name="file_ref"/>
       <entity name="procedure" pk="proc_id" query="select procedure_ref 
as proc_id from procedure where file_fk = ${file_id}>
         <field column="proc_id" name="procedure_ref"/>
	<entity name="organ" pk="organ_id" query="select organ_ref as organ_id 
from organ where procedure_fk = ${proc_id}>
           <field column="organ_id" name="organ_ref"/>

Any thoughts/links about how to properly denormalize - and obtain a 
cartesian product - a relational database ?

Bruno Dusausoy
Software Engineer
YP5 Software
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

View raw message