How to handle multiple MySQL tables by DataImportHandler in Solr?

I have 33 tables in MySQL. The search will use about 20 tables. What to do to process and search in all of these tables? I've already accomplished this by importing 1 table and looking at it clearly.

But now I want to search in all tables.

Am I creating an all new kernel for different tables? Or should I use JOIN queries when importing data? Please give me the best suggestions.


source to share

1 answer

It all depends on your requirement. You can do both. By creating a core for a single table or joining a couple of tables (consider 3-4 tables that are related to each other) together and indexing the data into the core.

I would suggest going with a later one, where this would minimize the lookup time. You can use DIH (Data Import Handler) where you can write a join query (get the selected search fields you want to search on) a couple of tables that are relevant. And when you have a search in a specific area, you can search in a specific core.

As with my application, the two main sections of the document are actions.

I have two different kernels called documents and actions.

I have indexed the document-related data in the document core. when there is a search request from the document area, the search is performed on the specific core ie Document.

The same applies to actions.

Multiple kernels allow you to have a single instance of Solr with separate configurations and indices, with their own configuration and schema for a wide variety of applications, yet still have the convenience of unified administration. The individual indexes are still fairly isolated, but you can manage them as a single application, create new indexes on the fly, create new SolrCores, and even force one SolrCore to replace another SolrCore without reloading your Servlet container.

for more details:



All Articles