Skip to content

Instantly share code, notes, and snippets.

@eskatos
Created November 11, 2016 11:05
Show Gist options
  • Select an option

  • Save eskatos/3359cf3f138bec804a12cddf83ff5e7f to your computer and use it in GitHub Desktop.

Select an option

Save eskatos/3359cf3f138bec804a12cddf83ff5e7f to your computer and use it in GitHub Desktop.
Elasticsearch 2.x local embedded
Settings settings = Settings.settingsBuilder().
put( "path.work", new File( new File( fileConfig.temporaryDirectory(), identity.toString() ), "work" ).getAbsolutePath() ).
put( "path.home", new File( new File( fileConfig.temporaryDirectory(), identity.toString() ), "home" ).getAbsolutePath() ).
put( "path.logs", new File( fileConfig.logDirectory(), identity.toString() ).getAbsolutePath() ).
put( "path.data", new File( fileConfig.dataDirectory(), identity.toString() ).getAbsolutePath() ).
put( "path.conf", new File( fileConfig.configurationDirectory(), identity.toString() ).getAbsolutePath() ).
put( "http.enabled", false ).
put( "index.cache.type", "weak" ).
put( "index.number_of_shards", 1 ).
put( "index.number_of_replicas", 0 ).
build();
node = NodeBuilder.nodeBuilder().
clusterName( clusterName ).
settings( settings ).
local( true ).
node();
client = node.client();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment