简体   繁体   English

Solr-索引MySQL数据库

[英]Solr - Index MySQL Database

每天添加新表时,是否有可能索引一个完整的数据库而不在data-config.xml中明确提及表名,而我每天都不能更改data-config.xml来添加新表。

Haven table names based on the date smells like there is something wrong in your Design. 基于日期的避风港表名称听起来像您的设计中有问题。 But given this requirement in your question you can add Data to your solr server without telling you have a DB. 但是鉴于您的问题中的这一要求,您可以在不告知您拥有数据库的情况下将数据添加到您的Solr服务器。 You just have to make sure you hav a unique ID for the data record in you solr Server with whom you can identify the corresponding record in your DB, something like abcd_2011_03_19.uniqueid . 您只需要确保对solr Server中的数据记录拥有唯一的ID,就可以使用它标识数据库中的相应记录,例如abcd_2011_03_19.uniqueid You can post the data to solr in Java in solrj or just plain xml or json. 您可以将数据发布到solrj中的Java solr中,也可以仅以纯xml或json形式发布。

Example: 例:

--------------
| User Input |
--------------
      |post
      V
-----------------------------------
| My Backend (generate unique id) |
-----------------------------------
  |post(sql)       |post (e.g. solrj)
  V                V
------           --------
| DB |           | solr |
------           --------

My ascii skillz are mad :D 我的ascii skillz很生气:D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM