createIndex=true 不会在 Elasticsearch 中创建索引映射
createIndex=true doesn't create the index mapping in Elasticsearch
createIndex=true 不使用 spring-data-elasticsearch
在 Elasticsearch 中创建索引映射
@Document(indexName = "profiles", shards=1, versionType = VersionType.INTERNAL, createIndex = true)
设置参数createIndex = true
(顺便说一句,这是默认值)本身不会做任何事情。
您需要有一个 Spring Data Elasticsearch 存储库,其实体 class 在您的应用程序中具有此注释,并且该索引必须尚不存在。
检查索引是否存在是在存储库引导时完成的,只有当索引不存在时,才会创建索引并将映射写入索引。
createIndex=true 不使用 spring-data-elasticsearch
在 Elasticsearch 中创建索引映射@Document(indexName = "profiles", shards=1, versionType = VersionType.INTERNAL, createIndex = true)
设置参数createIndex = true
(顺便说一句,这是默认值)本身不会做任何事情。
您需要有一个 Spring Data Elasticsearch 存储库,其实体 class 在您的应用程序中具有此注释,并且该索引必须尚不存在。
检查索引是否存在是在存储库引导时完成的,只有当索引不存在时,才会创建索引并将映射写入索引。