fix #872 add client.transport.*

This commit is contained in:
Shinsuke Sugaya 2017-02-03 20:54:58 +09:00
parent defe812876
commit 34f257e0ba
3 changed files with 59 additions and 0 deletions

View file

@ -257,6 +257,9 @@ public class FessEsClient implements Client {
} else {
final Builder settingsBuilder = Settings.builder();
settingsBuilder.put("cluster.name", fessConfig.getElasticsearchClusterName());
settingsBuilder.put("client.transport.sniff", fessConfig.isElasticsearchTransportSniff());
settingsBuilder.put("client.transport.ping_timeout", fessConfig.getElasticsearchTransportPingTimeout());
settingsBuilder.put("client.transport.nodes_sampler_interval", fessConfig.getElasticsearchTransportNodesSamplerInterval());
final Settings settings = settingsBuilder.build();
final TransportClient transportClient = new PreBuiltTransportClient(settings);
for (final TransportAddress address : transportAddressList) {

View file

@ -31,6 +31,15 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. http://localhost:9201 */
String ELASTICSEARCH_HTTP_URL = "elasticsearch.http.url";
/** The key of the configuration. e.g. true */
String ELASTICSEARCH_TRANSPORT_SNIFF = "elasticsearch.transport.sniff";
/** The key of the configuration. e.g. 1m */
String ELASTICSEARCH_TRANSPORT_ping_timeout = "elasticsearch.transport.ping_timeout";
/** The key of the configuration. e.g. 5s */
String ELASTICSEARCH_TRANSPORT_nodes_sampler_interval = "elasticsearch.transport.nodes_sampler_interval";
/** The key of the configuration. e.g. aes */
String APP_CIPHER_ALGORISM = "app.cipher.algorism";
@ -1131,6 +1140,34 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
String getElasticsearchHttpUrl();
/**
* Get the value for the key 'elasticsearch.transport.sniff'. <br>
* The value is, e.g. true <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getElasticsearchTransportSniff();
/**
* Is the property for the key 'elasticsearch.transport.sniff' true? <br>
* The value is, e.g. true <br>
* @return The determination, true or false. (if not found, exception but basically no way)
*/
boolean isElasticsearchTransportSniff();
/**
* Get the value for the key 'elasticsearch.transport.ping_timeout'. <br>
* The value is, e.g. 1m <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getElasticsearchTransportPingTimeout();
/**
* Get the value for the key 'elasticsearch.transport.nodes_sampler_interval'. <br>
* The value is, e.g. 5s <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getElasticsearchTransportNodesSamplerInterval();
/**
* Get the value for the key 'app.cipher.algorism'. <br>
* The value is, e.g. aes <br>
@ -4517,6 +4554,22 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
return get(FessConfig.ELASTICSEARCH_HTTP_URL);
}
public String getElasticsearchTransportSniff() {
return get(FessConfig.ELASTICSEARCH_TRANSPORT_SNIFF);
}
public boolean isElasticsearchTransportSniff() {
return is(FessConfig.ELASTICSEARCH_TRANSPORT_SNIFF);
}
public String getElasticsearchTransportPingTimeout() {
return get(FessConfig.ELASTICSEARCH_TRANSPORT_ping_timeout);
}
public String getElasticsearchTransportNodesSamplerInterval() {
return get(FessConfig.ELASTICSEARCH_TRANSPORT_nodes_sampler_interval);
}
public String getAppCipherAlgorism() {
return get(FessConfig.APP_CIPHER_ALGORISM);
}

View file

@ -11,6 +11,9 @@ domain.title = Fess
# Elasticsearch
elasticsearch.cluster.name=elasticsearch
elasticsearch.http.url=http://localhost:9201
elasticsearch.transport.sniff=true
elasticsearch.transport.ping_timeout=1m
elasticsearch.transport.nodes_sampler_interval=5s
# Cryptographer
app.cipher.algorism=aes