Index multiple tables using SOLR
There are various ways to do it and it depends on your table schema. Some simple ones would be like:
- If you have 2-3 different tables and they are kind of unrelated then in that case you need to have an extensive Solr schema and just index each table separately. You would perform this only when you desire to use Solr for just search on documents present in dissimilar tables.
- It’s like you have a table STUDENT (id,name,roll) and TEACHER (id,name,subject,qualification), you need to have these fields in your solr schema (id,name,roll,subject,qualification).
- Now index the two tables either by solrj or use Data Import Handler.
- If you have different tables and have relations between them then you need to write SQL queries which perform joins between them and get the columns that you would like to index into solr.
Indexing either of the two tables (and not both the tables):