Solr Delta导入查询不起作用 [英] Solr Delta Import Query is not working

查看:69
本文介绍了Solr Delta导入查询不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据从Mongodb导入到Solr6.0.完全导入正在正确执行,但增量导入无法正常工作.当我执行增量导入时,我得到以下结果.

I am trying to import data from Mongodb to Solr6.0. Full import is executing properly but delta import is not working. When I execute delta import I get below result.

请求:0,已提取:0,已跳过:0,已处理:0

Requests: 0 , Fetched: 0 , Skipped: 0 , Processed: 0

我的数据配置文件查询如下

My data config file queries are as below

query=""

deltaQuery="db.getCollection('customer').find({'jDate':{$gt:'${dih.last_index_time}'}},{'_id' :1});"
deltaImportQuery="db.getCollection('customer').find({'_id':'${dataimporter.delta.id}'})"

整个data-config.xml

the whole data-config.xml

<?xml version="1.0"?>
<dataConfig>
<dataSource name="MyMongo" type="MongoDataSource" database="test_db" />
<document name="import">
 <!-- if query="" then it imports everything -->
     <entity  processor="MongoEntityProcessor"
             query=""
             deltaQuery="db.getCollection('customer').find({'jDate':{$gt: '${dih.last_index_time}'}},{'_id' :1});"
             deltaImportQuery="db.getCollection('customer').find({'_id':'${dataimporter.delta.id}'})"
             collection="customer"   
             datasource="MyMongo"
             transformer="MongoMapperTransformer" name="sample_entity">

               <!--  If mongoField name and the field declared in schema.xml are same than no need to declare below.
                     If not same than you have to refer the mongoField to field in schema.xml
                    ( Ex: mongoField="EmpNumber" to name="EmployeeNumber"). -->                                              

           <field column="_id"  name="id"/>  
           <field column="CustID" name="CustID" mongoField="CustID"/>       

           <field column="CustName" name="CustName" mongoField="CustName"/>       
            <field column="jDate" name="jDate" mongoField="jDate"/>
            <field column="dob" name="dob" mongoField="dob"/>          
       </entity>
 </document>
</dataConfig>

我尝试使用硬编码的值,但仍然无法像下面那样工作

I tried with hardcoded values, but it still not worked like below

     query=""
     deltaQuery="db.getCollection('customer').find({'jDate':{$gt: new Date(1480581295000)}},{'_id' :1});"

deltaImportQuery="db.getCollection('customer').find({'_id':ObjectId('34234234dfsd34534524234ee')})"

然后我尝试执行以下操作,但仍然没有成功

And then I tried doing the below thing, but still no success

query=""
         deltaQuery="{'jDate':{$gt: new Date(1480581295000)}}"
        deltaImportQuery="{'_id':ObjectId(34234234dfsd34534524234ee)}"

任何人,请可以.

推荐答案

可以尝试

deltaQuery as db.getCollection('customer').find({'jDate':{$gt:**ISODate(**'${dih.last_index_time}'**)**}},{'_id' :1});

这篇关于Solr Delta导入查询不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆