下面是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"
}
}
}
}
}发布于 2020-02-20 00:41:14
elasticsearch中没有主键。每个文档都自动有一个_id字段,它是一种主键,因为它是惟一的标识符。
Elasticsearch会为每个字段创建索引,因此不需要指定一个作为主键。
https://stackoverflow.com/questions/60304562
复制相似问题