简体   繁体   English

弹性搜索的弹簧数据中useServerConfiguration()和createIndex()的含义

[英]Meaning of useServerConfiguration() and createIndex() in spring data for elastic search

Hi I recently upgraded from spring-data-elasticsearch 1.3.2 to 2.0.1. 嗨,我最近从spring-data-elasticsearch 1.3.2升级到2.0.1。 I noticed that there are two new attributes of @Document annotation: 我注意到@Document注释有两个新属性:

boolean useServerConfiguration() default false;
boolean createIndex() default true;

I'm struggling to find a documentation saying what these attributes actually mean? 我很难找到一份文件说明这些属性究竟意味着什么?

BTW: Also I'm quite surprised why spring data elastic search does not document properly any of the attrbutes of @Document. 顺便说一句:我也很惊讶为什么弹簧数据弹性搜索没有正确记录@Document的任何属性。

createIndex=true indicates that when Spring application starts, if configured index does not exist, then Spring creates the index. createIndex=true表示当Spring应用程序启动时,如果配置的索引不存在,则Spring会创建索引。

useServerConfiguration=true indicates that when the index is created by Spring, Spring does not set the following settings in the created index: shards, replicas, refreshInterval and indexStoreType. useServerConfiguration=true表示当Spring创建索引时,Spring不会在创建的索引中设置以下设置:shards,replicas,refreshInterval和indexStoreType。 These settings will be Elasticsearch defaults (server configuration). 这些设置将是Elasticsearch默认值(服务器配置)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM