大部分字段类型默认被索引的(inverted index),可以被搜索
search: 哪个文档有这个词
sort&aggregations: look up the document and find the terms that it has in a field.这个文档的这个字段的值是什么

doc_values

  1. 磁盘上的数据结构,在文档索引的时候建立,数据可以被访问。
  2. 和_source存的值是一样的,采用column-oriented fashion,更高效的排序和聚合
  3. doc_values的默认值是true,如果这个字段不需要排序和聚合,不需要在脚本里访问,可以禁用doc_values来节约磁盘空间,
    仍然可以被查询
  4. 可以被分词类型不支持doc_values
"session_id": {
"type": "keyword",
"doc_values": false
}

fielddata

  1. text fields 不支持doc_values,
  2. text使用fielddata,一种在查询时期生成在缓存里的数据结构
  3. 当字段在首次sort,aggregations,or in a script时创建,读取磁盘上所有segment的的倒排索引,反转 term<->doc 的关系,加载到jvm heap,it remains there for the lifetime of the segment.
  4. 很耗内存,默认禁用fielddata
  5. text field 是先分词再索引的,因此,应该使用不分词的keyword用来聚合
curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d'
{
"mappings": {
"my_type": {
"properties": {
"my_field": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
}
}
'

docvalue and fielddata的更多相关文章

  1. Es官方文档整理-3.Doc Values和FieldData

    Es官方文档整理-3.Doc Values和FieldData 1.Doc Values 聚合使用一个叫Doc Values的数据结构.Doc Values使聚合更快.更高效且内存友好. Doc Va ...

  2. Fielddata is disabled on text fields by default. Set fielddata=true on [gender] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memor

    ES进行如下聚合操作时,会报如题所示错误: ➜ Downloads curl -XPOST 'localhost:9200/bank/_search?pretty' -d ' { "size ...

  3. (转载)es进行聚合操作时提示Fielddata is disabled on text fields by default

    原文地址:http://blog.csdn.net/u011403655/article/details/71107415 根据es官网的文档执行 GET /megacorp/employee/_se ...

  4. es fielddata理解

    在es中,text类型的字段使用一种叫做fielddata的查询时内存数据结构.当字段被排序,聚合或者通过脚本访问时这种数据结构会被创建.它是通过从磁盘读取每个段的整个反向索引来构建的,然后存存储在j ...

  5. (转)es进行聚合操作时提示Fielddata is disabled on text fields by default

    根据es官网的文档执行 GET /megacorp/employee/_search { "aggs": { "all_interests": { " ...

  6. es进行聚合操作时提示Fielddata is disabled on text fields by default

    在进行派粗前,先执行以下操作 { "properties": { "updatedate": { "type": "text&qu ...

  7. python Fielddata is disabled on text fields

    # 执行https://www.elastic.co/guide/cn/elasticsearch/guide/current/_aggregation_test_drive.html中的例子时报错F ...

  8. Kibana error " Fielddata is disabled on text fields by default. Set fielddata=true on [publisher] ..."

    Reason of this error:Fielddata can consume a lot of heap space, especially when loading high cardina ...

  9. 56.fielddata filter的细粒度内存加载控制

    语法: POST /test_index/_mapping/test_type { "properties": { "test_field": { " ...

随机推荐

  1. web项目引用tomcat中的jar

    web项目引用tomcat中的jar https://blog.csdn.net/zjsdrs/article/details/77868827 如下图所示

  2. jquery动态添加的元素绑定的事件不生效的问题

    我们可以通过 $(document).on('click', '#xxx', callback) 这种形式解决. 原因,一般情况下,我们是通过 $('#xxx').click(callback) 这种 ...

  3. STL源码分析-deque

    http://note.youdao.com/noteshare?id=66f21dca07c1984f41848700021644fd

  4. rar 解压

    三.rar命令语法 将/etc 目录压缩为etc.rar 命令为: rar a etc.rar /etc 1 将etc.rar 解压 命令为: rar x etc.rar unrar -e etc.t ...

  5. 新式类 VS 经典类

    一.概述 Python中支持多继承,也就是一个子类可以继承多个父类/基类.当一个调用一个自身没有定义的属性时,它是按照何种顺序去父类中寻找的呢?尤其是当众多父类中都包含有同名的属性,这就涉及到新式类 ...

  6. 前端PHP入门-010-内部函数

    内部函数,是指在函数内部又声明了一个函数. 注意事项: 内部函数名,不能是已存在的函数名 假设在函数a里面定义了一个内部函数,不能调用两次函数a. <?php function foo() { ...

  7. Gogent相关问题的解决(不断更新)

    1:今天早上打开推特,发现进不去了,google浏览器一直提示404……找不到网址,真心郁闷.后来,查了查,才知道,最近google在北京的主干服务器被xx了,某些省就上不了了…… ……乱七八糟的不说 ...

  8. [LeetCode] 28. Implement strStr() ☆

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...

  9. Codeforces 221 D. Little Elephant and Array

    D. Little Elephant and Array time limit per test 4 seconds memory limit per test 256 megabytes input ...

  10. Codeforces 797 D. Broken BST

    D. Broken BST http://codeforces.com/problemset/problem/797/D time limit per test 1 second memory lim ...