Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取索引的某一个setting失败 #35

Open
WayneLee5991 opened this issue Nov 3, 2020 · 1 comment
Open

获取索引的某一个setting失败 #35

WayneLee5991 opened this issue Nov 3, 2020 · 1 comment
Assignees
Milestone

Comments

@WayneLee5991
Copy link

bboss版本:6.2.2
ES版本:7.3.2

ClientInterface的getIndiceSetting是获取索引的settings,第二个参数应该是获取指定的setting??当我把该参数设置为index.number_of_shards时,获取失败。DEBUG后发现拼接的路径为:indexName/_settings?index.number_of_shards,这样并不能获取。
通过kibana测试,获取该setting的正确路径应该为:indexName/_settings/index.number_of_shards,返回结果:
{
"indexName" : {
"settings" : {
"index" : {
"number_of_shards" : "1"
}
}
}
}

yin-bp added a commit that referenced this issue Nov 3, 2020
添加获取索引特定setting的值的方法:
		ClientInterface clientInterface = ElasticSearchHelper.getRestClientUtil();

		System.out.println(clientInterface.getIndiceSetting("demo","pretty"));//获取索引demo配置
		//获取指定的配置项的值
		System.out.println(clientInterface.getIndiceSettingByName("demo","index.number_of_shards"));
@yin-bp
Copy link
Contributor

yin-bp commented Nov 3, 2020

你使用的方法对应的第二个参数是一个格式化的控制参数:
clientInterface.getIndiceSetting("demo","pretty");//获取索引demo配置

新加了一个根据指定配置参数名称获取对应的设置值的方法:
//获取指定的配置项的值
clientInterface.getIndiceSettingByName("demo","index.number_of_shards");

@yin-bp yin-bp self-assigned this Nov 3, 2020
@yin-bp yin-bp added this to the v6.2.3 milestone Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants