multi level join in solr
===

Hi i have data in a 3 level tree structure. Can I use SOlr JOIN to get the root node when the user searches 3rd level node.

FOr example - 

        PATIENT1
           -> FirstName1
           -> LastName1
           -> DOCUMENTS1_1
        	    -> document_type1_1
        	    -> document_description1_1
        	    -> document_value1_1
        	    -> CODE_ITEMS1_1_1
        			-> Code_id1_1_1
        			-> code1_1_1
        	    -> CODE_ITEMS1_1_1
        			-> Code_id1_1_2
        			-> code1_1_2
           -> DOCUMENTS1_2
        	    -> document_type1_2
        	    -> document_description1_2
        	    -> document_value1_2
        	    -> CODE_ITEMS1_2_1
        			-> Code_id1_2_1
        			-> code1_2_1
        	    -> CODE_ITEMS1_2_2
        			-> Code_id1_2_2
        			-> code1_2_2
        PATIENT2
           -> FirstName2
           -> LastName2
           -> DOCUMENTS2_1
        	    -> document_type2_1
        	    -> document_description2_1
        	    -> document_value2_1
        	    -> CODE_ITEMS2_1_1
        			-> Code_id2_1_1
        			-> code2_1_1
        	    -> CODE_ITEMS2_1_2
        			-> Code_id2_1_2
        			-> code2_1_2


I want to search a CODE_ITEM and return all the patient that matches the code items search criteria. How can this be done. Is it possible to implement join twice. First join gives all the documents for the code_item search and the next join gives all the Patient.

Something like in SQL query -

    select * from patients where docID (select DOCID from DOCUMENTS where CODEID IN (select CODEID from CODE_ITEMS where CODE LIKE '%SEARCH_TEXT%'))