Search code examples
solrdataimporthandler

Solr: deltaQuery / parentDeltaQuery / deltaImportQuery


Solr's documentation for DataImportHandler gives this table for the entity query attributes.

enter image description here

That's not extremely descriptive. Can someone express here the difference and interaction between these query attributes? I have seen some code use deltaQuery and parentDeltaQuery to support nested entities, and I have seen others use deltaQuery and deltaImportQuery.

What is the purpose of choosing one of those over the other?


Solution

  • I see it now in the Solr Wiki:

    * The query gives the data needed to populate fields of the Solr document in full-import
    * The deltaImportQuery gives the data needed to populate fields when running a delta-import
    * The deltaQuery gives the primary keys of the current entity which have changes since the last index time
    * The parentDeltaQuery uses the changed rows of the current table (fetched with deltaQuery) to give the changed rows in the parent table. This is necessary because whenever a row in the child table changes, we need to re-generate the document which has that field.
    

    I missed this explanation on the first pass, and expected that information to show up in the table I posted. Strangely enough, Solr In Action spent less than 1 page of 600 explaining how to use DataImportHandler to read a database.