I am trying to get a delta import query working for my solr schema. When I do a full import the solr index gets populated correctly. However, when I try and do the delta import, it looks like it processes normally - and gives the following result in the solr gui:
Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
Requests: 1, Fetched: 0, Skipped: 0, Processed: 0
This is correct, as the database should have no updates since the full query.
However, when I do a full query of the core after the delta update, it shows all the documents are gone, and the core is empty! All of this I am doing through the solr web admin gui.
Here is the delta import handler config file:
<entity name="episode" query="select episode_id from db.episode"
deltaQuery="select episode_id from db.episode where last_modified > '${dih.last_index_time}'"
deltaImportQuery="select episode_id from db.episode where episode_id = '${dih.delta.episode_id}'">
</entity>
Here is the relevant stuff in the schema file:
<fields>
<field name='episode_id' indexed="true" stored="true" type='int' required="true"/>
</fields>
And here is the DIH stuff in my solrconfig.xml:
<lib dir="${solr.install.dir:../../../..}/lib/" regex="mysql-connector-java-5.1.35-bin.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">episodeDIHconfigfile.xml</str>
</lst>
</requestHandler>
Any ideas why this would be happening? I thought the delta query would just add to the index, and not just delete everything! All help much appreciated...