@ Given ( "^I connect to Elasticsearch cluster at host '(.+?)'( using native port '(.+?)')?( using cluster name '(.+?)')?$" ) public void connectToElasticSearch ( String host , String foo , String nativePort , String bar , String clusterName ) throws DBException , UnknownHostException , NumberFormatException { LinkedHashMap < String , Object > settings_map = new LinkedHashMap < String , Object > ( ) ; if ( clusterName != null ) { settings_map . put ( "cluster.name" , clusterName ) ; } else { settings_map . put ( "cluster.name" , ES_DEFAULT_CLUSTER_NAME ) ; } commonspec . getElasticSearchClient ( ) . setSettings ( settings_map ) ; if ( nativePort != null ) { commonspec . getElasticSearchClient ( ) . setNativePort ( Integer . valueOf ( nativePort ) ) ; } else { commonspec . getElasticSearchClient ( ) . setNativePort ( ES_DEFAULT_NATIVE_PORT ) ; } commonspec . getElasticSearchClient ( ) . setHost ( host ) ; commonspec . getElasticSearchClient ( ) . connect ( ) ; }
Connect to ElasticSearch using custom parameters