这是之前Lucene3.0生成的索引格式

a表

b表

c.这是网上找的图片(因为上面的两张表的segment都是合并了的)

lucene4.9 建立的索引:

索引(Index):
        在Lucene中一个索引是放在一个文件夹中的。
        如上图,同一文件夹中的所有的文件构成一个Lucene索引。
    段(Segment):
        一个索引可以包含多个段,段与段之间是独立的,添加新文档可以生成新的段,不同的段可以合并。
        如上图,具有相同前缀文件的属同一个段,图中共两个段 "_0" 和 "_1"。
        segments.gen和segments_5是段的元数据文件,也即它们保存了段的属性信息。
    文档(Document):
        文档是我们建索引的基本单位,不同的文档是保存在不同的段中的,一个段可以包含多篇文档。
        新添加的文档是单独保存在一个新生成的段中,随着段的合并,不同的文档合并到同一个段中。
    域(Field):
        一篇文档包含不同类型的信息,可以分开索引,比如标题,时间,正文,作者等,都可以保存在不同的域里。
        不同域的索引方式可以不同,在真正解析域的存储的时候,我们会详细解读。
    词(Term):
        词是索引的最小单位,是经过词法分析和语言处理后的字符串。

  • Segment info. This contains metadata about a segment, such as the number of documents, what files it uses,
  • Field names. This contains the set of field names used in the index.
  • Stored Field values. This contains, for each document, a list of attribute-value pairs, where the attributes are field names. These are used to store auxiliary information about the document, such as its title, url, or an identifier to access a database. The set of stored fields are what is returned for each hit when searching. This is keyed by document number.
  • Term dictionary. A dictionary containing all of the terms used in all of the indexed fields of all of the documents. The dictionary also contains the number of documents which contain the term, and pointers to the term's frequency and proximity data.
  • Term Frequency data. For each term in the dictionary, the numbers of all the documents that contain that term, and the frequency of the term in that document, unless frequencies are omitted (IndexOptions.DOCS_ONLY)
  • Term Proximity data. For each term in the dictionary, the positions that the term occurs in each document. Note that this will not exist if all fields in all documents omit position data.
  • Normalization factors. For each field in each document, a value is stored that is multiplied into the score for hits on that field.(这个值里面存储了一个当你命中它的时候的一个打分)
  • Term Vectors. For each field in each document, the term vector (sometimes called document vector) may be stored. A term vector consists of term text and term frequency. To add Term Vectors to your index see the Field constructors
  • Per-document values. Like stored values, these are also keyed by document number, but are generally intended to be loaded into main memory for fast access. Whereas stored values are generally intended for summary results from searches, per-document values are useful for things like scoring factors.
  • Deleted documents. An optional file indicating which documents are deleted.

文件格式对应缩写

.fdt   field data

.fdx   field index

.fnm  field name  This contains the set of field names used in the index 索引立面的域名

.frq   frequencies

.nrm  norms

.prx  ProxFile

.tii    term info index

.tis   term infos

.si    Segment info This contains metadata about a segment, such as the number of documents, what files it uses

段的元数据,如此段的文档数及应用的相关文件

segments.gen

segments_N

所谓正向信息:

  • 按层次保存了从索引,一直到词的包含关系:索引(Index) –> 段(segment) –> 文档(Document) –> 域(Field) –> 词(Term)
  • 也即此索引包含了那些段,每个段包含了那些文档,每个文档包含了那些域,每个域包含了那些词。
  • 既然是层次结构,则每个层次都保存了本层次的信息以及下一层次的元信息,也即属性信息,比如一本介绍中国地理的书,应该首先介绍中国地理的概况, 以及中国包含多少个省,每个省介绍本省的基本概况及包含多少个市,每个市介绍本市的基本概况及包含多少个县,每个县具体介绍每个县的具体情况。
  • 如上图,包含正向信息的文件有:

所谓反向信息:

  • 保存了词典到倒排表的映射:词(Term) –> 文档(Document)
  • 如上图,包含反向信息的文件有:

lucene文件格式待整理的更多相关文章

  1. lucene 检索流程整理笔记

  2. lucene 索引流程整理笔记

    索引的原文档(Document). 为了方便说明索引创建过程,这里特意用两个文件为例: 文件一:Students should be allowed to go out with their frie ...

  3. lucene学习笔记:三,Lucene的索引文件格式

    Lucene的索引里面存了些什么,如何存放的,也即Lucene的索引文件格式,是读懂Lucene源代码的一把钥匙. 当我们真正进入到Lucene源代码之中的时候,我们会发现: Lucene的索引过程, ...

  4. Lucene学习总结之三:Lucene的索引文件格式(1)

    Lucene的索引里面存了些什么,如何存放的,也即Lucene的索引文件格式,是读懂Lucene源代码的一把钥匙. 当我们真正进入到Lucene源代码之中的时候,我们会发现: Lucene的索引过程, ...

  5. Lucene学习之四:Lucene的索引文件格式(1)

    本文转载自:http://www.cnblogs.com/forfuture1978/archive/2009/12/14/1623597.html Lucene的索引里面存了些什么,如何存放的,也即 ...

  6. Lucene学习总结之三:Lucene的索引文件格式(1) 2014-06-25 14:15 1124人阅读 评论(0) 收藏

    Lucene的索引里面存了些什么,如何存放的,也即Lucene的索引文件格式,是读懂Lucene源代码的一把钥匙. 当我们真正进入到Lucene源代码之中的时候,我们会发现: Lucene的索引过程, ...

  7. Lucene 基础理论 (zhuan)

    http://www.blogjava.net/hoojo/archive/2012/09/06/387140.html**************************************** ...

  8. Solr4.8.0源码分析(8)之Lucene的索引文件(1)

    Solr4.8.0源码分析(8)之Lucene的索引文件(1) 题记:最近有幸看到觉先大神的Lucene的博客,感觉自己之前学习的以及工作的太为肤浅,所以决定先跟随觉先大神的博客学习下Lucene的原 ...

  9. 深入Lucene索引机制

    Lucene的索引里面存了些什么,如何存放的,也即Lucene的索引文件格式,是读懂Lucene源代码的一把钥匙. 当我们真正进入到Lucene源代码之中的时候,我们会发现: Lucene的索引过程, ...

随机推荐

  1. ZOJ 3747 - Attack on Titans (递推)

    题意:有三个兵种R,G,C,选取N个排成一列,要求G至少有M个连续的,R至多有K个连续的,问有多少种排列方式. 此题与UVa 10328 - Coin Toss非常相似,都是问某个字符连续出现的种数. ...

  2. oracle中的cluster表

    大家对通常oracle中的cluster的理解是不准确的,经常和sql server中的cluster index混淆.Cluster是存储一组table的一种方法,这些table共享同一数据块中的某 ...

  3. Ubuntu 14.10 下查看系统硬件信息(实例详解)

    linux查看系统的硬件信息,并不像windows那么直观,这里我罗列了查看系统信息的实用命令,并做了分类,实例解说. cpu lscpu命令,查看的是cpu的统计信息. blue@blue-pc:~ ...

  4. adaboost算法

    三 Adaboost 算法 AdaBoost 是一种迭代算法,其核心思想是针对同一个训练集训练不同的分类器,即弱分类器,然后把这些弱分类器集合起来,构造一个更强的最终分类器.(很多博客里说的三个臭皮匠 ...

  5. classPath

    问 spring mvc的web.xml中这个地方的classpath是什么意思? spring springmvc java swnuv 2015年09月25日提问 关注 5 关注 收藏 0 收藏, ...

  6. Oracle排序问题

    关于oracle排序的几点认识: (1)oracle本身不具有任何默认排序功能,要想排序,必须使用order by,而order by后的数据行默认是asc(升序排列),要降序选择desc : (2) ...

  7. hadoop中Text类 与 java中String类的区别

    hadoop 中 的Text类与java中的String类感觉上用法是相似的,但两者在编码格式和访问方式上还是有些差别的,要说明这个问题,首先得了解几个概念: 字符集: 是一个系统支持的所有抽象字符的 ...

  8. servlet容器处理请求过程

    下图是关于tomcat服务器接收客户请求并作出响应的图例. tomcat不仅仅只是一个servlet容器,也是一个web服务器,servlet容器在web服务器之内或者说servlet容器托管于web ...

  9. Planning for a period of time

    After a period of struggle , i decided to follow the teacher Chen learning . Say true i really disli ...

  10. linux命令:cp

    1.命令介绍: cp用来复制文件或目录,全称是copy 2.命令格式: cp [选项] [-T] 源 目的 或cp [选项] 源 目录 或cp [选项] -t 目录 源 3.命令参数: -a, --a ...