Hello everyone!

I would like to ask you a question about DIH and delta import.

I am trying to sync Solr with a PostgreSQL database and I have a field
"ent_lastModified" of type "timestamp without timezone".

Here is my xml file:

<dataConfig>
    <dataSource name="jdbc" driver="org.postgresql.Driver"
url="jdbc:postgresql://host" user="XXX" password="XXX" readOnly="true"
autoCommit="false"
        transactionIsolation="TRANSACTION_READ_COMMITTED"
holdability="CLOSE_CURSORS_AT_COMMIT"/>
    <document>
        <entity name='myEntity' dataSource='jdbc' pk='id'
                query=' SELECT * FROM Entities'
                deltaImportQuery='SELECT "ent_id" AS "id" FROM
"Entities" WHERE "ent_id"=${dataimporter.delta.id}"'
          deltaQuery=' SELECT "ent_id" AS "id" FROM "Entities" WHERE
"ent_lastModified" &gt; &#39;${dataimporter.last_index_time}&#39;'
                >
        </entity>
    </document>
</dataConfig>

Full-import works fine, but when I run a delta-import the
"ent_lastModified" field, I get the corresponding records, but the
"ent_lastModified" stays the same, so if I make another delta-import,
the same records are retreived.

I have read all the documentation at
http://wiki.apache.org/solr/DataImportHandler but I could not find an
update query for the "last_modified" field and Solr does not seem to
do this automatically.
I have also tried to name the field "last_modified" as in the example,
but its value keeps unchanged after a delta-import.

Can anyone point me in the right direction?

Thanks in advance!
Juan M.

Reply via email to