es - elasticsearch mapping - parameters - eager_global_ordinals

68 阅读1分钟

世界上并没有完美的程序,但是我们并不因此而沮丧,因为写程序就是一个不断追求完美的过程。

问 :eager_global_ordinals有什么特点?
答 :
在这里插入图片描述

问 :eager_global_ordinals如何使用?
答 :

# eager_global_ordinals
PUT /global_ordinals_test
{
  "mappings" : {
    "properties" : {
      "name" : {
        "type"                  : "keyword",
        "eager_global_ordinals" : true
      }
    }
  }
}

GET /global_ordinals_test/_mapping

# 结果
{
  "global_ordinals_test" : {
    "mappings" : {
      "properties" : {
        "name" : {
          "type" : "keyword",
          "eager_global_ordinals" : true
        }
      }
    }
  }
}


PUT /global_ordinals_test_2
{
  "mappings" : {
    "properties" : {
      "name" : {
        "type"                  : "keyword",
        "eager_global_ordinals" : false
      }
    }
  }
}

GET /global_ordinals_test_2/_mapping

# 结果
{
  "global_ordinals_test_2" : {
    "mappings" : {
      "properties" : {
        "name" : {
          "type" : "keyword"
        }
      }
    }
  }
}