Skip to content

Instantly share code, notes, and snippets.

@markharwood
Created September 23, 2014 19:28
Show Gist options
  • Save markharwood/0cecd5019dbd5c4e90fc to your computer and use it in GitHub Desktop.
Save markharwood/0cecd5019dbd5c4e90fc to your computer and use it in GitHub Desktop.
Issue 7840 workaround
TransportClient esClient = new TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name", clusterName).build());
// ======= Start hack======
Field f = esClient.getClass().getDeclaredField("injector");
f.setAccessible(true);
Injector injector = (Injector) f.get(esClient);
injector.createChildInjector(new SignificantTermsHeuristicModule());
// ======= End hack======
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment