solr索引

来源:互联网 发布:vb中and和or的优先级 编辑:程序博客网 时间:2024/04/28 17:10

1、添加索引

DiseaseField field = IndexUtil.disease2IndexField(entity, guanLian);
LuceneContext.getInstance().getServer().addBean(field);

     根据id删除索引:根据id得到实体然后调用上面的方法addIndexById(Long entityId,InitGuanLianData guanLian)

2、根据id删除索引

LuceneContext.getInstance().getServer().deleteById(Var.DISEASE_CATEGORY+"_"+id);

3、更新索引

    this.addIndex(entity, guanLian);

根据id更新索引this.addIndexById(entityId, guanLian);