0

I am having some issues with solr Delta-import from MongoDB. Tried to do it from solr console using "delta-import" command. It executes successfully as log file indicates, but no delta import is happening in reality.

In solr data-config.xml

<dataConfig>
    <dataSource name="MyMongo" type="MongoDataSource" database="solr-test" />
    <document name="import">
        <entity  processor="MongoEntityProcessor"
                 query="" collection="zips" datasource="MyMongo"
                 deltaImportQuery="{id:{$eq:'${dih.delta.id}'}}"
                 deltaQuery="{id.getTimeStamp():{$gt:'${dih.last_index_time}'}}"
                 transformer="MongoMapperTransformer" name="sample_entity">
            <field column="_id"  name="id"/>               
        </entity>
    </document>
</dataConfig>

In mongoDB, I have inserted the following record.

db.zips.insert({ 
    "_id" : "99961", 
    "city" : "New York", 
    "loc" : [ -133.18479, 55.942471 ], 
    "pop" : 422, "state" : "NY" 
}) 

After inserting this record, when I tried with "full-import", it's working fine but no luck with "delta-import". Please help.

cheffe
  • 9,345
  • 2
  • 46
  • 57
abhijit nag
  • 451
  • 6
  • 24
  • try full import with adding a query in query attribute.... – Abhijit Bashetti Sep 23 '15 at 11:33
  • Your attribute `query=""` is empty and that works? – cheffe Sep 24 '15 at 08:01
  • Yes cheffe, that works with "full-import". – abhijit nag Sep 24 '15 at 11:45
  • @AbhijitBashetti, could you please put some light on "adding a query in query attribute". As I have already done with "full-import" query with success, so do you want me to change the query for "delta-import" ? – abhijit nag Sep 24 '15 at 12:11
  • I believe you have the same problem as the one in the link below: [https://stackoverflow.com/questions/58965037/solr-mongo-docdb-delta-import-query-is-not-working/60668539#60668539](https://stackoverflow.com/questions/58965037/solr-mongo-docdb-delta-import-query-is-not-working/60668539#60668539) – Mihai Stancu Mar 13 '20 at 10:21

0 Answers0