My Solr data source is a SQL database where the primary key is compound (i.e. it's two fields).
This is fine for my main DIH query
, I just concatenate the fields and that becomes my Solr primary key. However it's unclear from the documentation how I'd write a delta-import query to support this.
The documentation suggests I need two queries - one to find the primary key of the changed rows, and another to then actually retrieve the individual documents corresponding to each of those keys. There's no example showing this for compound keys though.
Ideally I don't want those two separate queries at all, it would put less load on the database if those two queries were simply combined such that the only difference between query
and deltaQuery
is the WHERE
clause that filters based on last_changed
.
So, if my main query
is:
SELECT key1 || key2 as pk FROM table
What would the relevant deltaQuery
(and/or deltaImportQuery
) look like?
I tried just adding the WHERE
clause but after the query ran I got a warning about the missing deltaImportQuery
and then a null-pointer exception. This is running the trunk code from SVN as of 18th December.