lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gupta, Saurabh " <>
Subject Child entity not getting index using DIH
Date Mon, 30 Nov 2009 02:47:36 GMT

I am using Solr to index two database tables with a very simple relationship.

Table 1: PRODUCT has ID as PK
Table 2: VERSION has ID as PK and PRODUCT_ID as PK

There is a 1:m relationship between PRODUCT AND VERSION.

When I run full-import, for some reason only 1 row in VERSION table is indexed per PRODUCT
row. I am attaching the data-config here.

Any help is appreciated.



    <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/jpa_test" user="JPA_TEST" password="JPA_TEST" />
    <document name="products">
        <entity name="product" query="select * from PRODUCT" pk="ID"
            deltaQuery="select ID from product where date_modified > '${dataimporter.last_index_time}'"
            deltaImportQuery="select * from PRODUCT where ID=${}">
            <field column="ID" name="productId" />
            <field column="NAME" name="productName" />
            <field column="DESCRIPTION" name="productDescription" />
            <field column="OWNER" name="productOwner" />
            <field column="MODIFIED_BY" name="productModifiedBy" />
            <field column="DATE_CREATED" name="productDateCreated" />
            <field column="DATE_MODIFIED" name="productDateModified" />

            <entity name="productVersion" pk="ID"
                query="select * from PRODUCT_VERSION where PRODUCT_ID=${product.ID}"
                deltaQuery="select ID, PRODUCT_ID from PRODUCT_VERSION where DATE_MODIFIED
> '${dataimporter.last_index_time}'"
                parentDeltaQuery="select ID from PRODUCT where ID=${productVersion.PRODUCT_ID}">
                <field column="ID" name="productVersionId" />
                <field column="NAME" name="productVersionName" />
                <field column="DESCRIPTION" name="productVersionDescription" />
                <field column="OWNER" name="productVersionOwner" />
                <field column="MODIFIED_BY" name="productVersionModifiedBy" />
                <field column="DATE_CREATED" name="productVersionDateCreated" />
                <field column="DATE_MODIFIED" name="productVersionDateModified" />
                <field column="VERSION_ORDER" name="productVersionOrder" />
                <field column="PRODUCT_VERSION_FORMAT_ID" name="productVersionFormatID"

View raw message