문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top