简体   繁体   English

使用来自MySQL中许多不同关系表的数据来运行Solr

[英]Getting Solr to run, with data from many different relational tables in MySQL

We wish to implement faceted searching, and faster search results for our system. 我们希望为我们的系统实现多面搜索和更快的搜索结果。 I've researched a bit, and Solr seems to be an amazing thing, exactly what we need. 我研究了一下,Solr似乎是一件了不起的事情,正是我们需要的。 But, none of us have worked with Solr before, and before we start overhauling our system to work nicely with Solr, I want to know how to migrate data from MySQL to Solr, or set it up so Solr can read the database. 但是,以前我们都没有使用过Solr,在我们开始全面检查系统以使其与Solr正常工作之前,我想知道如何将数据从MySQL迁移到Solr,或者进行设置以便Solr可以读取数据库。 The catch is that the data is in many different tables. 问题在于数据在许多不同的表中。

For example, a product might have attributes, childs, pricing, tags, all in different tables. 例如,一个product可能具有属性,子项,定价,标签,它们都在不同的表中。 Would Solr be able to access all of these tables properly, and connect them to the right product? Solr是否能够正确访问所有这些表,并将它们连接到正确的产品?

Or, would we need to create a (huge) xml file in which each product is placed, with all the relevant attributes? 或者,我们是否需要创建一个(巨大的) xml文件,在其中放置所有产品以及所有相关属性? We're at just shy of 50.000 products now, but we expect growth up to hundreds of percents in the coming two years. 我们现在只有5万种产品,但我们预计在未来两年内将增长数百%。

Solr comes with a contrib module called DataImportHandler [1] which is able to gather data from several sources, database included. Solr带有一个名为DataImportHandler [1]的contrib模块,该模块能够从多个来源(包括数据库)收集数据。

It is highly configurable and easy to use. 它是高度可配置的,并且易于使用。 I suggest you to try that, as it is IMHO the simplest way for your scenario. 我建议您尝试一下,因为恕我直言,这是解决方案的最简单方法。


[1] https://wiki.apache.org/solr/DataImportHandler [1] https://wiki.apache.org/solr/DataImportHandler

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

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