简体   繁体   English

如何在Solr中通过DataImportHandler处理多个MySQL表?

[英]How to handle Multiple MySQL Tables by DataImportHandler in Solr?

I have 33 Tables in MySQL. 我在MySQL中有33个表。 Around 20 Tables will use in Search. 搜索中将使用大约20个表。 What to do to Handle and Search in All this Tables? 如何处理和搜索所有这些表? I have already Implement this by Importing 1 table and search it clearly. 我已经通过导入1表来实现这一点并清楚地搜索它。

But now I want to search in all tables.. 但现在我想搜索所有表格..

Do I create all new core for different Tables ?? 我是否为不同的表创建了所有新核心? Or I Should use JOIN queries on importing Data ?? 或者我应该在导入数据时使用JOIN查询? Please give me better suggestions. 请给我更好的建议。

It all depends on the your requirement. 这一切都取决于您的要求。 You can do both ways By creating core for the individual table or By joining couple of tables(consider 3-4 tables which are related with each other) together and indexing the data into a core. 您可以通过以下两种方式创建:为单个表创建核心或通过连接几个表(考虑3-4个彼此相关的表)并将数据索引到核心。

I would suggest to go with the later where it would minimize the search time. 我建议你选择稍后会缩短搜索时间的地方。 You can use the DIH(Data import Handler) where in you can write a join query for(get the selected search fields on which you want to search) couple of tables which have a relation. 您可以使用DIH(数据导入处理程序)在其中编写连接查询(获取您要搜索的选定搜索字段)几个具有关系的表。 And when you have a search with specific area you can search in the specific core. 当您搜索特定区域时,您可以搜索特定核心。

As I have in my application, two main areas document, activities. 正如我在我的申请中所说,两个主要领域是文件,活动。

I have two different core named document and activities. 我有两个不同的核心命名文档和活动。

I have indexed the data related to documents in the document core. 我已将与文档核心中的文档相关的数据编入索引。 when there is search request from the document area, the search is performed on the specific core ie Document. 当存在来自文档区域的搜索请求时,对特定核心即文档执行搜索。

Same applies to Activities. 同样适用于活动。

Multiple cores let you have a single Solr instance with separate configurations and indexes, with their own config and schema for very different applications, but still have the convenience of unified administration. 通过多个内核,您可以拥有一个具有单独配置和索引的Solr实例,并为不同的应用程序提供自己的配置和架构,但仍然具有统一管理的便利性。 Individual indexes are still fairly isolated, but you can manage them as a single application, create new indexes on the fly by spinning up new SolrCores, and even make one SolrCore replace another SolrCore without ever restarting your Servlet Container. 单个索引仍然相当孤立,但您可以将它们作为单个应用程序进行管理,通过启动新的SolrCore来动态创建新索引,甚至可以使一个SolrCore替换另一个SolrCore,而无需重新启动Servlet容器。

for more detailed information : https://wiki.apache.org/solr/CoreAdmin 有关更多详细信息,请访问: https//wiki.apache.org/solr/CoreAdmin

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

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