摘要:
TermsHashPerField 类一、类功能概述:负责词项的索引过程,每个字段有相应的一个TermsHashPerField;当索引某字段词项时,使用对应TermsHashPerField的add()函数完成(一个)词项索引过程,并将索引内容(词项字符串/指针信息/位置信息等)存储于内存缓冲中二、类成员说明:2.1 final int streamCount;如果需要记录词频和位置,此值为2(... 阅读全文
摘要:
一. TermHashPerField.add()方法 这一章继续上面的内容, 上一章谈到TermHashPerField.add()方法就是把一个Term加入到posting表的过程, 那么下面我将从算法的角度来分析这个add()方法: final char[] tokenText = termAtt.termBuffer();; final int to... 阅读全文
摘要:
一. consumer的来源 接着上一小节的内容, 还是从这一段程序(位于DocumentWriter.updateDocument(Document, Analyzer, Term) 中继续. try { // This call is not synchronized and does all the // work final DocWriter pe... 阅读全文
摘要:
这一小结的内容我将大概讲讲IndexFiles的一个过程. 为了方便查看, 还是把IndexFile.java的源代码放在前面. 1: public class IndexFiles { 2: 3: private IndexFiles() {} 4: 5: static final File INDEX_DIR = new File("index"); 6: 7: /** Index all t... 阅读全文