私はsolr 4.2を使用しています。フル インポートは機能しますが、なぜかデルタ インポートは機能しないことに注意してください。差分インポートではエラーは発生しませんが、変更がフェッチされることはありません。ここにデータ構成ファイルがあります。
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver:testsql;databaseName=test"
user="dba"
password="dba"/>
<script>
<![CDATA[
function metadataTransformer (row) {
var attributeName = row.get("attribute_name");
var attributeValue = row.get("attribute_value");
row.put(attributeName, attributeValue);
return row;
}
]]>
</script>
<document name="PRODUCTS">
<entity name="product" query="select distinct p.product_id as id from products p
inner join products_meta pm on p.product_id = pm.product_id
inner join meta m on pm.meta_id = m.meta_id
where m.meta_type_id = 11 order by id desc"
deltaImportQuery="select distinct p.product_id as id from products p
inner join products_meta pm on p.product_id = pm.product_id
inner join meta m on pm.meta_id = m.meta_id
where m.meta_type_id = 11 and p.product_id='${dih.delta.product_id}'"
deltaQuery= "select distinct product_id as id from products
where updtime > '${dih.last_index_time}'">
<field column="id" name="id"/>
<entity name="attribute" query="select attribute_name,attribute_value from solr_import
where id =${product.id}" transformer= "script:metadataTransformer">
</entity>
</entity>
</document>
</dataConfig>
これが私が運なしで試したことです。
p.product_id='${dih.delta.product_id} を p.product_id='${dih.delta.id} に変更し、その他の方法も変更します。where updtime > '${dih.last_index_time}'" を where updtime > '${dih.last_index_time}'" に変更します
助けてください。