最新的lucene 3.0的field是这样的:

Field options for indexing
Index.ANALYZED – use the analyzer to break the Field’s value into a stream of separate tokens and make each token searchable.
Index.NOT_ANALYZED – do index the field, but do not analyze the String. Instead, treat the Field’s entire value as a single token and make that token searchable. 
Index.ANALYZED_NO_NORMS – an advanced variant of Index.ANALYZED which does not store norms information in the index. 
Index.NOT_ANALYZED_NO_NORMS – just like , but also do not store Norms.
Index.NO – don’t make this field’s value available for searching at all.

Field options for storing fields
Store.YES — store the value. When the value is stored, the original String in its entirety is recorded in the index and may be retrieved by an IndexReader.
Store.NO – do not store the value. This is often used along with Index.ANALYZED to index a large text field that doesn’t need to be retrieved in its original form.

Field options for term vectors
TermVector.YES – record the unique terms that occurred, and their counts, in each document, but do not store any positions or offsets information.
TermVector.WITH_POSITIONS – record the unique terms and their counts, and also the positions of each occurrence of every term, but no offsets.
TermVector.WITH_OFFSETS – record the unique terms and their counts, with the offsets (start & end character position) of each occurrence of every term, but no positions.
TermVector.WITH_POSITIONS_OFFSETS – store unique terms and their counts, along with positions and offsets.
TermVector.NO – do not store any term vector information.
If Index.NO is specified for a field, then you must also specify TermVector.NO.

具一些例子来说明这些怎么用
Index                   Store  TermVector                                Example usage 
NOT_ANALYZED     YES         NO                                        Identifiers (file names, primary keys),
                                                                                         Telephone and Social Security
                                                                                         numbers, URLs, personal names, Dates
ANALYZED              YES     WITH_POSITIONS_OFFSETS    Document title, document abstract
ANALYZED              NO      WITH_POSITIONS_OFFSETS    Document body
NO                         YES        NO                                        Document type, database primary key
NOT_ANALYZED     NO         NO                                         Hidden keywords

When Lucene builds the inverted index, by default it stores all necessary information to implement the Vector Space model. This model requires the count of every term that occurred in the document, as well as the positions of each occurrence (needed for phrase searches).
You can tell Lucene to skip indexing the term frequency and positions by calling:
Field.setOmitTermFreqAndPositions(true)

摘自:http://www.cnblogs.com/fxjwind/archive/2011/07/04/2097705.html

最新文章

  1. JDBC API Description
  2. YY前端课程-自习
  3. Entity Framework Code Migration 新建、更新数据库
  4. Python操作Redis、Memcache、RabbitMQ、SQLAlchemy
  5. phoenix与spark整合
  6. Java 程序优化:字符串操作、基本运算方法等优化策略(二)
  7. Java程序执行过程
  8. 小结JS中的OOP(下)
  9. 提高HTML5 canvas性能的几种方法
  10. 流(stream)
  11. linux下配置squid http proxy过程
  12. Oracle 11g-R2 SQL Developer连接MSSQL2008
  13. HtmlAgilityPack - 简介
  14. windows 7 命令修改IP地址
  15. Redis面试点
  16. ADO.NET基础学习 一(连接数据库)
  17. unity常用小知识点
  18. 配置文件备份方案(expect+shell)
  19. 上海支付宝终面后等了两周,没能收到offer却来了杭州淘宝的电话面试
  20. cocos2d-x游戏引擎核心之十——网络通信

热门文章

  1. POJ 2411 状压dp
  2. [转发]Android 系统稳定性 - ANR(二)
  3. Django实现的博客系统中使用富文本编辑器ckeditor
  4. python type
  5. 【spring boot Mybatis】报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add
  6. 如何更改ORACLE 用户的 expired状态
  7. BUPT复试专题—串查找(?)
  8. C++常用字符串分割方法
  9. 最近遇到的C++数字和字符串的转换问题
  10. iOS开发核心语言Objective C —— 全部知识点总结