大部分字段类型默认被索引的(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. SQL注入9种绕过WAF方法

    SQL注入9种绕过WAF方法 0x01前言 WAF区别于常规 防火墙 是因为WAF能够过滤特定Web应用程序的内容,而常规防火墙则充当服务器之间的防御门.通过检查HTTP的流量,它可以防御Web应用安 ...

  2. vmware中ubuntu虚拟机扩容

    https://blog.csdn.net/ldzm_edu/article/details/78893721

  3. Android Studio常用的快捷键

    罗列一些常用的快捷键 全局快捷键(比较重要的)   ALT + ENTER 工程快速修复 CTRL + SHIFT + A 快速查找 CTRL + ALT + L (Win) 格式化代码(我的锁屏的快 ...

  4. atom插件安装引发的nodejs和npm安装血案

    最近在写前端网页,学习就要从高大上的地方开始,于是我打算装一个atom编辑器. 本来就是由github客户端的,再装个atom也算是配套了吧,其实本白也是蛮费心思的,技术不怎么地,什么神器都再努力地使 ...

  5. HDU 2586 倍增法求lca

    How far away ? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  6. Codeforces 311.E Biologist

    E. Biologist time limit per test 1.5 seconds memory limit per test 256 megabytes input standard inpu ...

  7. mac 的全文搜索

    grep -Rni "view.proptypes.style" *  需要切换到要搜索的目录在运行

  8. flex属性设置详解

    CSS代码中常见这样的写法:flex:1 这是flex 的缩写: flex-grow.flex-shrink.flex-basis,其取值可以考虑以下情况: 1. flex 的默认值是以上三个属性值的 ...

  9. 2017北京国庆刷题Day2 morning

    期望得分:100+100+40=240 实际得分:100+40+0=140 T1 一道图论神题(god) Time Limit:1000ms   Memory Limit:128MB 题目描述 LYK ...

  10. ZOJ 3774 Fibonacci的K次方和

    In mathematics, Fibonacci numbers or Fibonacci series or Fibonacci sequence are the numbers of the f ...