Lucene4.3进阶开发之李代桃僵( 八) - fnm



Lucene4.3进阶开发之李代桃僵( 八) - fnm
这个文件存储的主要是域(Fileds)字段名,在索引文件中的后缀名为.fnm。
下面先来看下.fnm的数据类型。

Header--> CodecHeader
FieldsCount-->VInt
FieldName-->String
FieldBits, DocValuesBits-->Byte
FieldNumber-->VInt
Attributes-->Map<String,String>
DocValuesGen-->Int64 


FieldsCount:记录的是域名在当前文件的数量
FieldName:域名在文件中保存为UTF-8字符串
FieldNumber:字段的编号,
FieldBits:一个字节包含字段的选项信息
(1)低阶位是1代表是索引字段,bit为0代表非索引(Indexs)字段
(2)第二个低阶位是1代表有向量存储,bit为0代表无向量(term vectors)存储
(3)第三个低阶位被设置成(0x4),offsets(偏移量)将会被存储在倒排链表里,除了位置信息
(4)第四个bit位从未被使用过
(5)第五个bit位被设置成(0x10),norm(加权基准)将会被忽略在索引字段里
(6)第六个bit位被设置成(0x20),payload(载荷)将会被被存储在索引字段里
(7)第七个bit位被设置成(0x40),term frequencies(词频) and positions(位置)将会在索引字段里被忽略
(8)第八个bit位被设置成(0x80),positions(位置)信息,将不会被忽略在索引字段里
DocValuesBits:
一个字节包含每个文档的值类型,这个被记录用2个4位字节的int类型,高阶位代表(norms)加权基准的选项,
低阶位代表DocValues的选项,每个4位字节的整数可以被解码:

0:代表这个字段没有存储DocVlues
1:数字类型的NumericDocValues
2:二进制类型的BinaryDocValues
3:排序类型的SortedDocValues

DocValuesGen是字段的DocValues里面的数量,如果这个值为1,代表着
没有DocValues更新该字段,其他任何大于0的数字代表其被更新存储通过DocValuesFormat.

Attributes:一个K-V映射的编码的属性存储。
DocValuesFormat:作用是为每个文档进行编码以及解码的工作,如果有自己定义的格式需要加入或扩展
可以继承改类,为了能够使段文件读取,必须需要定义格式名,这个方法使用的是JAVA的SPI进行定义的
,在扩展的类里面必须有一个无参的构造函数以确保SPI可以解析。

Please read full article from Lucene4.3进阶开发之李代桃僵( 八) - fnm

No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts