Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4788

Multiple Entities DIH delta import: dataimporter.[entityName].last_index_time is empty

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2, 4.3
    • Fix Version/s: 4.4, 6.0
    • Labels:
      None
    • Environment:

      Description

      conf/dataimport.properties
      entity1.last_index_time=2013-05-06 03\:02\:06
      last_index_time=2013-05-06 03\:05\:22
      entity2.last_index_time=2013-05-06 03\:03\:14
      entity3.last_index_time=2013-05-06 03\:05\:22
      
      conf/solrconfig.xml
      <?xml version="1.0" encoding="UTF-8" ?>
      ...
      
      
          <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
              <lst name="defaults">
                  <str name="config">dihconfig.xml</str>
              </lst>
          </requestHandler>
      ...
      
      conf/dihconfig.xml
      <?xml version="1.0" encoding="UTF-8" ?>
      <dataConfig>
          <dataSource name="source1"
                      type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
                      url="jdbc:mysql://*:*/*"
                      user="*" password="*"/>
      
          <document name="strings">
              <entity name="entity1" pk="id" dataSource="source1"
                      query="SELECT * FROM table_a"
                      deltaQuery="SELECT table_a_id FROM table_b WHERE last_modified > '${dataimporter.entity1.last_index_time}'"
                      deltaImportQuery="SELECT * FROM table_a WHERE id = '${dataimporter.entity1.id}'"
                      transformer="TemplateTransformer">
                  <field> ...
                    ... 
                  ... </field>
              </entity>
              <entity name="entity2">
                    ... 
                    ...
              </entity>
              <entity name="entity3">
                    ... 
                    ...
              </entity>
          </document>
      </dataConfig>
      

       

      In above setup, dataimporter.entity1.last_index_time is empty string and cause the sql query having error

        Attachments

        1. SOLR-4788.patch
          3 kB
          James Dyer
        2. entitytest.patch
          7 kB
          Shawn Heisey
        3. entitytest.patch
          8 kB
          Shawn Heisey
        4. entitytest.patch
          4 kB
          Shawn Heisey
        5. entitytest.patch
          4 kB
          Shawn Heisey
        6. entitytest.patch
          5 kB
          Shawn Heisey

          Issue Links

            Activity

              People

              • Assignee:
                shalinmangar Shalin Shekhar Mangar
                Reporter:
                chakming chakming wong
              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: