DIH中的delta-import问题(delta-import problem in solr DIH)
当我运行full_import命令时,它工作正常。 更新的日期被写入dataimport.properties文件。 当我运行delta-import时,索引失败。 回滚所有更改。dataimport.properties文件已创建,并具有solr / conf / location中的777权限。
请帮我解决这个问题。
@mbonaci
data-config.xml中的查询deltaImportQuery和deltaQuery如下所示
<entity name="item" query="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status, 'GROUP' as itemtype,group_id as id from collaboration_groups where group_status=1" deltaImportQuery="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status,group_id as id,'GROUP' as itemtype from collaboration_groups where group_status=1 and group_id=${dataimporter.delta.id} " deltaQuery="select group_id from collaboration_groups where group_status=1 and updated_date > '${dataimporter.last_index_time}'" deletedPkQuery="select group_id from collaboration_groups where group_status = 0 and updated_date > '${dataimporter.last_index_time}'"> <field column="id" name="id" /> <field column="itemtype" name="itemtype" /> <field column="group_title" name="fullName" /> <field column="description" name="description"/> <field column="createdDate" name="createdDate"/> </entity>
config.xml中dataImport请求处理程序的config参数如下
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">/var/solr/data-config.xml</str> </lst> </requestHandler>
When I run full_import command it is working fine. The updated dates are written to dataimport.properties file. When I run delta-import it is giving Indexing failed. Rolled back all changes.. The dataimport.properties file was already created and have the 777 permissions in solr/conf/ location.
Please Help me to solve this problem.
@mbonaci
the query,deltaImportQuery and deltaQuery in data-config.xml is as follows
<entity name="item" query="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status, 'GROUP' as itemtype,group_id as id from collaboration_groups where group_status=1" deltaImportQuery="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status,group_id as id,'GROUP' as itemtype from collaboration_groups where group_status=1 and group_id=${dataimporter.delta.id} " deltaQuery="select group_id from collaboration_groups where group_status=1 and updated_date > '${dataimporter.last_index_time}'" deletedPkQuery="select group_id from collaboration_groups where group_status = 0 and updated_date > '${dataimporter.last_index_time}'"> <field column="id" name="id" /> <field column="itemtype" name="itemtype" /> <field column="group_title" name="fullName" /> <field column="description" name="description"/> <field column="createdDate" name="createdDate"/> </entity>
the config parameter of the dataImport request handler in config.xml is as follows
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">/var/solr/data-config.xml</str> </lst> </requestHandler>
原文:https://stackoverflow.com/questions/5203239
最满意答案
也许这样做会:
select id from user u, audit a where u.id=a.record and a.action='MODIFY' and a.field='NAME' and a.id = (select max(id) from audit a2 where a2.record=u.id)
Here is my solution...
MAX (FIELD_NAME) KEEP (DENSE_RANK FIRST ORDER BY OPERATION_DT)
相关问答
更多-
linux 结构体命名规则[2024-03-18]
record -
获取满足Pandas中多个条件的行号和列号(Getting the row and column numbers that meets multiple conditions in Pandas)[2023-10-29]
你是对的np.where将是一种方法。 这是一个实现 - # Extract the values from c into an array for ease in further processing c_arr = c.values # Use np.where to get row and column indices corresponding to three comparisons column_zero, row_zero = np.where(c_arr==0) column_negat ... -
也许这样做会: select id from user u, audit a where u.id=a.record and a.action='MODIFY' and a.field='NAME' and a.id = (select max(id) from audit a2 where a2.record=u.id) Here is my solution... MAX (FIELD_NAME) KEEP ...
-
如果你想要一种具有多种尺寸的样式,那么你可以使用exists : select m.* from da.stylesize m where exists (select 1 from da.stylesize m2 where m2.style_cd = m.style_cd and m2.size_cd <> m.size_cd) and rownum = 1; 然后,您要确保在da.stylesize(style_cd, size_cd)上有索引。 使用此查询,您甚至不需要进行聚合,这应该 ...
-
一个可能的答案是这样的。 创建每个ID最大(创建)日期和ID全部为NULL的列表。 select t1.* from myTable t1 join ( select id, max(created) as created from myTable where rating is not NULL group by id UNION ALL select id, max(created) as created from myTable t3 where rating is ...
-
尝试使用FirstOrDefault ,如果没有对象满足条件,它将返回null : var myObject = db.MinimumProductInfo.FirstOrDefault(pc => pc.ItemCode == productInfoWithNote.ItemCode && pc.Region == productInfoWithNote.Region); if(myObject != null) { // use your obje ...
-
是的,方法是update_all。 # Update all books with 'Rails' in their title Book.update_all "author = 'David'", "title LIKE '%Rails%'" http://apidock.com/rails/ActiveRecord/Relation/update_all Yes, the method is update_all. # Update all books with 'Rails' in their t ...
-
这和你要做的一样好,但我可能会把它重新写成一个EXISTS : UPDATE li SET IsUnsubscribed = 1 FROM dbo.ListItems AS li -- always use schema prefix! WHERE IsUnsubscribed = 0 AND EXISTS ( SELECT 1 FROM dbo.ListItems WHERE Md5Hash = li.Md5Hash AND IsUnsubscribed ...
-
你能加订单吗? ICriteria cr = Session.CreateCriteria
(); cr.AddOrder(Order.Desc("Id")); MyType justone = cr.UniqueResult(); Can you add an Order? ICriteria cr = Session.CreateCriteria (); cr.AddOrder(Order.Desc("Id")); MyType justone = cr.Uniqu ... -
怎么样: 数据: create table exp ( ItemGroupID int, CheckNumber int ); Insert into exp values (281, 101) ; Insert into exp values (274, 101) ; Insert into exp values (103, 101) ; Insert into exp values (281, 101) ; Insert into exp values (280, 10 ...