Last active
April 22, 2021 19:54
-
-
Save waleedsamy/60d08c6b5a47dadb217b to your computer and use it in GitHub Desktop.
solr delta import and deletedPkQuery example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dataConfig> | |
<dataSource name="DATA_SOURCE" driver="com.mysql.jdbc.Driver" | |
url="jdbc:mysql://10.10.10.10:3306/rm" user="user" password="pass" /> | |
<document name="DOC_NAMES"> | |
<entity name="ENTITY_NAME" dataSource="DATA_SOURCE" pk="serial_no" | |
query = "SELECT nri.id id, | |
nri.name name | |
FROM rm.nri nri ;" | |
deltaImportQuery="SELECT nri.id id, | |
nri.name name | |
FROM rm.nri nri where nri.serial_no='${dih.delta.serial_no}'" | |
deltaQuery="select serial_no from rm.nri where modification_date > '${dih.last_index_time}'" | |
deletedPkQuery="SELECT PK_DATA as serial_no from rm.CONTROL | |
WHERE INSERT_DATE > '${dih.last_index_time}' | |
AND TABLE_NAME = 'rm.nri' | |
AND ACTION_TYPE IN ('DELETE')" | |
> | |
</entity> | |
</document> | |
</dataConfig> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment