Fieldcache:

 docID->document->fieldvalue

无论是聚类排序关联等,首先都需要获得文档中某个字段的值,通过docID去获得整个document,然后再去获得字段值,term转换得到最终值,FieldCache一开始就缓存了所有文档的某个特定域(所有数值类型以及不分词的stringField)的值到内存,便于随机存取该域值!

Fieldcache实现过程:

http://moshalanye.iteye.com/blog/281379

缺点:

1. 常驻内存,大小是所有文档个数特定域类型大小

2. 初始加载过程耗时,需要遍历倒排索引及类型转换

Docvalues:

docID->fieldvalue

建索引时,建立了document到field value的面向列的正排索引数据结构,直接通过已知的docID定位到字段值,从而无需加载document,亦不需要term转换,遍历term找寻doc等的过程

优点:大约节省三分之一的内存!

缺点:由于是硬盘读取,而非内存模式,对于大批量的使用下,优势明显,速度更优;小量情况下没有内存快!总体会慢15-20%

20 February 2015 - Apache Lucene 5.0.0 and Apache Solr 5.0.0 Available

http://lucene.apache.org/

FieldCache is gone (moved to a dedicated UninvertingReader in the misc module). This means when you intend to sort on a field, you should index that field using doc values, which is much faster and less heap consuming than FieldCache.

LUCENE-5666:Change uninverted access (sorting, faceting, grouping, etc) to use the DocValues API instead of FieldCache

Es中

https://www.elastic.co/guide/en/elasticsearch/guide/current/doc-values.html

Sorl中

http://wiki.apache.org/solr/DocValues?cm_mc_uid=56088888487714180880058&cm_mc_sid_50200000=1448507379

https://cwiki.apache.org/confluence/display/solr/DocValues

docvalues和Fieldcache的更多相关文章

  1. Lucene系列-FieldCache

    域缓存,加载所有文档中某个特定域的值到内存,便于随机存取该域值. 用途及使用场景 当用户需要访问各文档中某个域的值时,IndexSearcher.doc(docId)获得Document的所有域值,但 ...

  2. 1.4.9 DocValues

    DocValues 在solr4.2以后,引入了一个令人兴奋的功能,这个功能在lucene存在已经一段时间了,但是还没有在solr中使用. 在某些方面,DocValue 是一种非常有效的索引方式. 为 ...

  3. Solr4.2 新特性 DocValues [转]

    原文地址http://wiki.apache.org/solr/DocValues DocValues从Lucene4.2和Solr4.2开始加入,通过建立字段的正排索引,提升sorting, fac ...

  4. lucene DocValues——本质是为通过docID查找某field的值 看图

    Why DocValues? The standard way that Solr builds the index is with an inverted index. This style bui ...

  5. lucene DocValues——本质是为通过docID查找某field的值

    什么是docValues? docValues是一种记录doc字段值的一种形式,在例如在结果排序和统计Facet查询时,需要通过docid取字段值的场景下是非常高效的. 为什么要使用docValues ...

  6. Lucene中string docvalues使用utf-16的优化

    原来的string docvalues使用utf-8编码,载入时转码花费大量时间,我们把转码实现从new String(bytes, "UTF-8")改用lucene的bytesR ...

  7. Solr DocValues详解

    前言: 在Lucene4.x之后,出现一个重大的特性,就是索引支持DocValues,这对于广大的solr和elasticsearch用户,无疑来说是一个福音,这玩意的出现通过牺牲一定的磁盘空间带来的 ...

  8. 用Lucene实现分组,facet功能,FieldCache

    假如你像用lucene来作分组,比如按类别分组,这种功能,好了你压力大了,lucene本身是不支持分组的. 当你想要这个功能的时候,就可能会用到基于lucene的搜索引擎solr. 不过也可以通过编码 ...

  9. Elasticsearch中的DocValues

    Elasticsearch最近一段时间非常火,以致于背后的公司都改名为Elastic了,因为Elasticsearch已经不仅限于搜索,反而更多的用在大数据分析场景,所以在公司品牌上开始“去Searc ...

随机推荐

  1. 最精简的django程序

    一.程序框架 1.结构图

  2. bugfree安装

    1.下载xampp文件:xampp-linux-x64-5.5.30-3-installer.run 2.安装此文件,用root账号安装,安装命令:./xampp-linux-x64-5.5.30-3 ...

  3. oracle with as

    http://blog.csdn.net/a9529lty/article/details/4923957/

  4. HBase Cassandra Riak HyperTable

    Cassandra                                                              HBase 一致性 Quorum NRW策略 通过Goss ...

  5. js中的cookie操作

    一.js cookie   使用时把此段代码引入页面 (function (factory) { if (typeof define === 'function' && define. ...

  6. DownloadManager补漏

    原始完成于:2014-10-24 20:01:03 DownloadManager是一个处理HTTP下载请求的系统服务: 1. 基本用法 1 private void download() { 2 R ...

  7. Hive Over HBase

    1. 在hbase上建测试表 hbase(main)::> create 'test_hive_over_hbase','f' row(s) in 2.5810 seconds hbase(ma ...

  8. 实验一《开发环境的熟悉》&实验二《固件设计》

    20145312&20145338 实验一<开发环境的熟悉>&实验二<固件设计> 合作博客链接:http://www.cnblogs.com/yx2014531 ...

  9. 001 今天开始系统学习C#

    2016-01-16 之前只是大概了解过c#语言,感觉掌握不牢靠.现在开始系统学习C#.现以该博客作为学习笔记,方便后续查看.C# 目标:系统掌握c#知识 时间:30天 范围:C#基础,Winform ...

  10. find_in_set()

    $where[]="find_in_set('".$grades."',a.grades)";