Hi folks, I've just solved using outer joins like this:
<entity name="documento" query="SELECT d.iddocumento,d.nrodocumento,td.idtipodocumento,td.nombre AS nombretipodocumento FROM documento d LEFT OUTER JOIN tipodocumento td ON (d.tipodocumento = td.idtipodocumento)"> <field column="iddocumento" name="iddocumento" /> <field column="nrodocumento" name="nrodocumento" /> <field column="idtipodocumento" name="idtipodocumento" /> <field column="nombretipodocumento" name="nombretipodocumento" /> Any idea why I can't index using sub-entities? Thanks in advance On Mon, Jun 4, 2012 at 11:13 AM, Rafael Taboada <kaliman.fore...@gmail.com>wrote: > Hi folks, > > I'm using DIH in order to index my Oracle database but I'm having some > issues. > > Right now, I can't index fields from sub-entities. I have in my > db-data-config.xml: > > <dataConfig> > <dataSource type="JdbcDataSource" name="jdbc" > driver="oracle.jdbc.OracleDriver" > url="jdbc:oracle:thin:@localhost:1521:mydata" > user="oracle" password="oracle" /> > <document> > <entity name="documento" query="SELECT > iddocumento,nrodocumento,tipodocumento FROM documento"> > <field column="iddocumento" name="iddocumento" /> > <field column="nrodocumento" name="nrodocumento" /> > <field column="tipodocumento" name="tipodocumento" /> > <entity name="tipodocumento" query="SELECT nombre FROM > tipodocumento where idtipodocumento = '${documento.tipodocumento}'"> > <field column="nombre" name="nombre" /> > </entity> > </entity> > </document> > </dataConfig> > > My schema.xml is: > > <field name="iddocumento" type="string" indexed="true" stored="true" > required="true" /> > <field name="nrodocumento" type="string" indexed="true" > stored="true" /> > <field name="tipodocumento" type="string" indexed="true" > stored="true" /> > <field name="nombre" type="string" indexed="true" stored="true" /> > > I can't index NOMBRE field. Is this because it belongs to a sub-entity? > > Thanks for your help > > -- > Rafael Taboada > > -- Rafael Taboada /* * Phone >> 992 741 026 */