Solr Full Import全量导入
所谓全量索引一般指的是每次从数据库中读取需要导入的全部数据,然后提交到Solr Server,最后删除指定core的所有索引数据进行重建。全量导入一般在数据首次导入或者备份数据恢复时执行。
以下为一个多表查询的全量导入案例:
ER图:
ER图
根据如上ER图,我们在数据库中执行如下SQL建表并插入测试数据。
use solr;
create table feature(item_id bigint,descrip varchar(80));
create table item(id bigint, item_name varchar(20), manu varchar(20), weight float,price float, popularity int, includes varchar(20));
create table item_category(item_id bigint, category_id bigint);
create table category(id bigint, descrip varchar(80));
alter table item add primary key(id);
alter table item_category add primary key(item_id, category_id);
alter table category add primary key(id);
insert into item values(1,"item1", "menu1", 12.0,