Lucene Field.Stror Field.Index

从Lucene的源代码中,可以看出Field 典型构造函数如下:

Field(String name, String value, Field.Store store, Field.Index index)

其中:

Field.Index有四种属性,分别是:

Field.Index.TOKENIZED:分词索引

Field.Index.UN_TOKENIZED:不分词进行索引,如作者名,日期等,不再需要分词。

Field.Index.NO:不进行索引,存放不能被搜索的内容如文档的一些附加属性如文档类型, URL等。

Field.Index.NO_NORMS:不分词,建索引.但是Field的值不像通常那样被保存,而是只取一个byte,这样节约存储空间。

Field.Store也有三个属性,分别是:

Field.Store.YES:索引文件本来只存储索引数据, 此设计将原文内容直接也存储在索引文件中,如文档的标题。

Field.Store.NO:原文不存储在索引文件中,搜索结果命中后,再根据其他附加属性如文件的Path,数据库的主键等,重新连接打开原文,适合原文内容较大的情况。

          Field.Store.COMPRESS 压缩存储。

 

Field Summary static 
           Index the tokens produced by running the field's value through an Analyzer. static 
           Expert: Index the tokens produced by running the field's value through an Analyzer, and also separately disable the storing of norms. static 
           Do not index the field value. static 
          Deprecated. This has been renamed to static 
           Index the field's value without using an Analyzer, so it can be searched. static 
           Expert: Index the field's value without an Analyzer, and also disable the storing of norms. static 
          Deprecated. this has been renamed to static 
          Deprecated. This has been renamed to

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值