1.术语

lucene 在存储它的全文索引结构时,是有层次结构的,这涉及到5个层次:索引(Index);段(Segment);文档(Document);域(Field);词(Term),他们的关系如下图所示:(lucene 索引存储结构概念图)

下图是Lucene生成的索引的一个实例,右边是对这5个层次的描述:

 

2.基本原理

2.1 lucene架构

 

2.2 创建索引

 

 

 IndexWriter W = new IndexWriter(FSDirectory.open(indexdir),

new  StandardAnalyzer(version.LUCENE_30,IndexWriter.MaxFieldLength.UNLIMITED));

2.3 查询索引

 

3.参考资料

【1】https://blog.csdn.net/ghj1976/article/details/5586329

【2】https://sebol.webs.com/architectureoverview.htm

【3】https://sebol.webs.com/creatingaluceneindex.htm

【4】https://sebol.webs.com/searchingtheindex.htm

posted on 2018-11-09 10:07  一天不进步,就是退步  阅读(829)  评论(0编辑  收藏  举报