On 7/6/2018 5:53 AM, shruti suri wrote: > Please help me with delta import form one oracle table into solr. I don't > have any primary key in the table. We need to use composite key using > (LOCAL_MASTER_ID,LOCAL_ID). > > <entity name="item" pk="ID" transformer="TemplateTransformer" > > query="select * from data.vw_data_ref" > deltaQuery="select concat(LOCAL_ID,LOCAL_MASTER_ID) as ID from > data.vw_data_ref where UPDATED_DATE > > to_date('${dataimporter.last_index_time}', 'YYYY-MM-DD HH24:MI:SS')" > deltaImportQuery="select concat(LOCAL_ID,LOCAL_MASTER_ID) from > data.vw_data_ref where ID='${item.ID}'"> > > <field column="ID" template="${item.LOCAL_ID}${item.LOCAL_MASTER_ID}" /> > </entity>
I'm going to say much the same thing that Alexandre did, and maybe give a little more detail. Your message did not ask a question or indicate what your problem is. Your subject says that delta import isn't working. But you didn't provide any information about what "not working" means -- no error messages, no indication of what's happening and how that compares with what you expect to happen. Here's some concrete information I can give you from your config: You have pk="ID" in your entity definition. This means that *ALL* of your SQL queries *must* return a field with the name "ID". If one of them does not contain that field, Solr is going to throw an error and refuse to run the import. The "deltaImportQuery" does not return a field named "ID". If your table does not contain this field, then the "query" isn't returning it either. Also, your deltaImportQuery is only returning one field. This means that even if you can get the import working (which might involve adding "as ID" to the query as Alexandre mentioned), only the one field being returned will be contained in any documents imported by a delta-import. Thanks, Shawn