elasticsearch,Amazon Web Services,Performance,Templates,elasticsearch" /> elasticsearch,Amazon Web Services,Performance,Templates,elasticsearch" />

Amazon web services Elasticsearch:在模板中使用特殊字段作为P.K.改进研究

Amazon web services Elasticsearch:在模板中使用特殊字段作为P.K.改进研究,amazon-web-services,performance,templates,elasticsearch,Amazon Web Services,Performance,Templates,elasticsearch,以下是ElasticSearch中的一个模板,我的问题是,是否有办法将其中一个字段(例如timeStamp)提升为主键,以帮助查询期间的研究;就像它通常发生在数据库上一样 { "order": 0, "template": "simsamples-*", "settings": { "index": { "number_of_shards": "1" } }, "mappings": { "ProbeSamples": {

以下是ElasticSearch中的一个模板,我的问题是,是否有办法将其中一个字段(例如
timeStamp
)提升为主键,以帮助查询期间的研究;就像它通常发生在数据库上一样

  {
  "order": 0,
  "template": "simsamples-*",
  "settings": {
    "index": {
      "number_of_shards": "1"
    }
  },
  "mappings": {
    "ProbeSamples": {
      "properties": {
        "date": {
          "index": "no",
          "type": "string"
        },
        "timeStamp": {
          "format": "epoch_second",
          "type": "date"
        },
        "temperatures": {
          "type": "double"
        },
        "id": {
          "index": "not_analyzed",
          "type": "string"
        }
      }
    }
  }
}

elasticsearch中没有主键。每个文档都自动有一个
\u id
字段,这是一种主键,因为它是唯一的标识符


Elasticsearch正在为每个字段创建索引,因此无需指定一个作为主键。

问题是,如何在Elasticsearch中创建/优化模板以获得更快的响应?如果有,我使用的是旧版本的ES:2.4.5。现在,阅读关于映射和关键字的文章,他们是否关心我的原始问题,优化模板领域的研究?