tags:

views:

102

answers:

1

The delta import syntax for the Solr 1.4 data import handler allows for up to 4 queries (query, deltaImportQuery, deltaQuery & parentDeltaQuery), but I am unclear on the usage of the "query" query.

In the following example, the "query" query does the same as the deltaImportQuery without the where clause.

<entity name="data-table" pk="id"
        query="select id,Subject,Text,UserID,CreatedDate,TopicID,TopicType,EPiPageID,ForumID,Room1ID,Room1Name,LastModifiedDate from dbo.CustomForumPosts"
        deltaImportQuery="select id,Subject,Text,UserID,CreatedDate,TopicID,TopicType,EPiPageID,ForumID,Room1ID,Room1Name,LastModifiedDate from dbo.CustomForumPosts where id='${dataimporter.delta.id}'"
        deltaQuery="select id from dbo.CustomForumPosts where LastModifiedDate > '${dataimporter.last_index_time}'">            
</entity>

I don't understand why, or if, I need the "query" query - it would appear to do nothing more than describe the full import equivalent of this delta. Can anyone explain?

+1  A: 

Hi!

Query refers to the query that is used when doing a full import as you implied. The documentation says:

  • 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

http://wiki.apache.org/solr/DataImportHandler#Using_delta-import_command

John P
Ah, so when I command a full-import using this data config, it uses the "query" query and when I command a delta-import it uses the delta components. Is that correct?
Jibberish
Yes, that is the way it works.
John P