在配置好与MYSQL的数据源基础上,做增量更新索引,总结如下
1.data-config.xml内容修改为
<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/demo" user="root" password=""/>
    <document name="products">
       <entity name="item" pk="id"
          query="SELECT id,title,contents,last_index_time FROM solr_articles"
          deltaImportQuery="SELECT id,title,contents,last_index_time FROM solr_articles
            WHERE id = '${dataimporter.delta.id}'"
          deltaQuery="SELECT id FROM solr_articles
            WHERE last_index_time > '${dataimporter.last_index_time}'">
        </entity>
    </document>
</dataConfig>
更新成功之后,conf/dataimport.properties时间会改变
3.通过对http://localhost:8080/solr/dataimport?command=delta-import定时请求达到定时增量更新索引目的

相关文章:

  • 2021-09-20
  • 2021-12-08
  • 2021-10-17
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2021-05-16
猜你喜欢
  • 2021-11-15
  • 2021-11-22
  • 2021-05-25
  • 2022-02-01
  • 2021-11-05
  • 2021-07-04
相关资源
相似解决方案