Question

I have Solr configured and indexing / running smoothly. The only problem is it cannot do delta-imports. It only dumps messages like:

INFO: id is a required field in SolrSchema . But not found in DataConfig

but I have the id in schema defined as:

<field column="id" name="id_l"/>

Another message shows the delta import was not completed:

INFO: Completed ModifiedRowKey for Entity: description rows obtained : 0

My schema has:

<entity name="user"  pk="id" query="SELECT * FROM users"
   deltaImportQuery="SELECT * FROM users WHERE id = '${dataimporter.delta.id}'"
   deltaQuery="SELECT id FROM users WHERE updated_at > '${dataimporter.last_index_time}'"
 >
 ..

EDIT: The above was set according to the Wiki. But after looking into example-DIH's DataConfig, I changed the above to:

<entity name="user"  pk="id" query="SELECT * FROM users"
  deltaQuery="SELECT id FROM users WHERE updated_at > '${dataimporter.last_index_time}'"  
>

but it still doesn't work.

My question is - how can I change the schema in order to be able to delta-import the data?

Was it helpful?

Solution

I debugged the app, and the problem was that the app or MySQL stored the times incorrectly, that is, earlier than the actual time. So when Delta index was run, Solr threw the correct time to the query, but since it was LATER than the 'mysql' time, it just didn't do anything. This link helped me to debug.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top