lucene1.0.1写入分析

 

一、参考

 

Lucene in Action (In Action series)

lucene1.0.1 源码

yz lucene1.0.1

倒排索引

String interning

 

二、基本数据名词

 

 

2.1 term

 

A Term represents a word from text.

This is the unit of search.

It is composed of two elements,

(1) the text of the word, as a string,

(2) and the name of the field that the text occured in, an interned string

Note that terms may represent more than words from text fields,

but also things like dates, email addresses, urls, etc.

 


public final class Term {
  String field;
  String text;
}

 

2.2 termInfo

 

A TermInfo is the record of information stored for a term.

 


final class TermInfo {
  /** The number of documents which contain the term. */
  int docFreq = 0;

  long freqPointer = 0;
  long proxPointer = 0;
}

 

 

2.3 posting

 

info about a Term in a doc

 


final class Posting { // info about a Term in a doc
  Term term; // the Term
  int freq; // its frequency in doc
  int[] positions; // positions it occurs at
}

 

posted @ 2021-01-22 10:45  一曲广陵散yz  阅读(61)  评论(0编辑  收藏  举报