lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Fischer <>
Subject Nested entities not imported / do not show up in search?
Date Fri, 16 Oct 2015 11:40:04 GMT
Hello everybody,

I am trying to import from an Oracle DB 11g2 via DIH using SOLR 5.3.1. 
In my relational DB there are company addresses (table tb_firmen_adressen) and branches (table
tb_branchen). They have an n:m relationship using the join table tb_firmen_branchen. 
Now I would like to find companies by their name and in each company result I would like to
see the associated branches.
However I only get the companies without the nested entries. As a newbie I'd highly appreciate
some help as there are no errors or warnings in the log file and I could not find any helpful
hints in the documentation or elsewhere in the internet concerning my problem. 

Here is my data config:

        <dataSource name="jdbc" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@//xxxxx.xxxxxxx:1521/pde11"
user="myuser" password="mysecret"/>
        <entity name="firma" pk="fa.EBI_NR" query="
            FROM tb_firmen_adressen fa 
            WHERE rownum &lt; 10000
            <field name="firma_ebi_nr"        	 	column="EBI_NR" />
            <field name="firma_namenszeile_1" 	column="NAMENSZEILE_1" />
            <field name="firma_namenszeile_2" 	column="NAMENSZEILE_2" />
            <field name="firma_namenszeile_3" 	column="NAMENSZEILE_3" />
            <entity name="firma_branche" child="true" query="
                SELECT b.EBC_CODE AS EBC_CODE
                    tb_firmen_branchen fb 
                        JOIN tb_branchen b ON fb.EBC_CODE = b.EBC_CODE 
                WHERE fb.EBI_NR='${firma.firma_ebi_nr}'
                <field name="branche_ebc_code" column="EBC_CODE" />
                <!-- I would like to add more fields later here once I get it to work -->

And here are the relevant lines from my schema file:


     <field name="firma_ebi_nr" 		type="long" 		required="true" 	indexed="true" 	stored="true"/>
     <field name="firma_namenszeile_1" 	type="text_general" 				indexed="true" 	stored="true"/>
     <field name="firma_namenszeile_2" 	type="text_general" 				indexed="true" 	stored="true"/>
     <field name="firma_namenszeile_3" 	type="text_general" 				indexed="true" 	stored="true"/>
     <field name="branche_ebc_code" 		type="long" 					indexed="true" 	stored="true"/>

After restarting solr and calling http://localhost:8983/solr/jcg/dataimport?command=full-import
I get "Indexing completed. Added/Updated: 9999 documents. Deleted 0 documents."
So basically it seams to work, but my search results look like this:

      "q":"Der Bunte",
        "firma_namenszeile_1":"Der Bunte Laden",

Why are there no company branches inside the company records? What's wrong with my configuration?
Any help is appreciated!

Kind regards
Matthias Fischer

View raw message