You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2012/11/01 16:29:03 UTC
[Solr Wiki] Update of "DataImportHandler" by JamesDyer
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "DataImportHandler" page has been changed by JamesDyer:
http://wiki.apache.org/solr/DataImportHandler?action=diff&rev1=324&rev2=325
Comment:
changed delta namespace from "dataimport.delta" to "dih.delta". The longer name doesn't work in all instances.
* '''`deltaQuery`''' : Only used in delta-import
* '''`parentDeltaQuery`''' : Only used in delta-import
* '''`deletedPkQuery`''' : Only used in delta-import
- * '''`deltaImportQuery`''' : (Only used in delta-import) . If this is not present , DIH tries to construct the import query by(after identifying the delta) modifying the '`query`' (this is error prone). There is a namespace `${dataimporter.delta.<column-name>}` which can be used in this query. e.g: `select * from tbl where id=${dataimporter.delta.id}` <!> [[Solr1.4]].
+ * '''`deltaImportQuery`''' : (Only used in delta-import) . If this is not present , DIH tries to construct the import query by(after identifying the delta) modifying the '`query`' (this is error prone). There is a namespace `${dih.delta.<column-name>}` which can be used in this query. e.g: `select * from tbl where id=${dih.delta.id}` <!> [[Solr1.4]].
== Commands ==
<<Anchor(commands)>> The handler exposes all its API as http requests . The following are the possible operations
@@ -261, +261 @@
<document name="products">
<entity name="item" pk="ID"
query="select * from item"
- deltaImportQuery="select * from item where ID='${dataimporter.delta.id}'"
+ deltaImportQuery="select * from item where ID='${dih.delta.id}'"
- deltaQuery="select id from item where last_modified > '${dataimporter.last_index_time}'">
+ deltaQuery="select id from item where last_modified > '${dih.last_index_time}'">
<entity name="feature" pk="ITEM_ID"
query="select description as features from feature where item_id='${item.ID}'">
</entity>
@@ -284, +284 @@
{{{
deltaQuery="select id from item where id in
- (select item_id as id from feature where last_modified > '${dataimporter.last_index_time}')
+ (select item_id as id from feature where last_modified > '${dih.last_index_time}')
or id in
(select item_id as id from item_category where item_id in
- (select id as item_id from category where last_modified > '${dataimporter.last_index_time}')
+ (select id as item_id from category where last_modified > '${dih.last_index_time}')
- or last_modified > '${dataimporter.last_index_time}')
+ or last_modified > '${dih.last_index_time}')
- or last_modified > '${dataimporter.last_index_time}'"
+ or last_modified > '${dih.last_index_time}'"
}}}
* Writing a huge deltaQuery like the above one is not a very enjoyable task, so we have an alternate mechanism of achieving this goal.
@@ -298, +298 @@
<dataSource driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:/temp/example/ex" user="sa" />
<document>
<entity name="item" pk="ID" query="select * from item"
- deltaImportQuery="select * from item where ID=='${dataimporter.delta.id}'"
+ deltaImportQuery="select * from item where ID=='${dih.delta.id}'"
- deltaQuery="select id from item where last_modified > '${dataimporter.last_index_time}'">
+ deltaQuery="select id from item where last_modified > '${dih.last_index_time}'">
<entity name="feature" pk="ITEM_ID"
query="select DESCRIPTION as features from FEATURE where ITEM_ID='${item.ID}'"
- deltaQuery="select ITEM_ID from FEATURE where last_modified > '${dataimporter.last_index_time}'"
+ deltaQuery="select ITEM_ID from FEATURE where last_modified > '${dih.last_index_time}'"
parentDeltaQuery="select ID from item where ID=${feature.ITEM_ID}"/>
<entity name="item_category" pk="ITEM_ID, CATEGORY_ID"
query="select CATEGORY_ID from item_category where ITEM_ID='${item.ID}'"
- deltaQuery="select ITEM_ID, CATEGORY_ID from item_category where last_modified > '${dataimporter.last_index_time}'"
+ deltaQuery="select ITEM_ID, CATEGORY_ID from item_category where last_modified > '${dih.last_index_time}'"
parentDeltaQuery="select ID from item where ID=${item_category.ITEM_ID}">
<entity name="category" pk="ID"
query="select DESCRIPTION as cat from category where ID = '${item_category.CATEGORY_ID}'"
- deltaQuery="select ID from category where last_modified > '${dataimporter.last_index_time}'"
+ deltaQuery="select ID from category where last_modified > '${dih.last_index_time}'"
parentDeltaQuery="select ITEM_ID, CATEGORY_ID from item_category where CATEGORY_ID=${category.ID}"/>
</entity>
</entity>