Skip to content

Commit

Permalink
SAK-27715 support ability to make sakai nodes client only to ES
Browse files Browse the repository at this point in the history
  • Loading branch information
johntbush committed Jan 5, 2015
1 parent a658c7d commit 9a50b38
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ public class ElasticSearchService implements SearchService {
private ElasticSearchIndexBuilder indexBuilder;
private SiteService siteService;
private boolean localNode = false;

/**
* set this to true if you intend to run an ElasticSearch cluster that is external to Sakai
* this instructs ES to not store any data on the local node but only act as a client
*/
private boolean clientNode = false;

private boolean useSiteFilters = false;

/**
Expand Down Expand Up @@ -228,6 +235,7 @@ protected void initializeElasticSearch() {
ImmutableSettings.Builder settings = settingsBuilder().put(properties);

node = nodeBuilder()
.client(clientNode)
.settings(settings)
.local(localNode).node();

Expand Down Expand Up @@ -856,6 +864,10 @@ public void setLocalNode(boolean localNode) {
this.localNode = localNode;
}

public void setClientNode(boolean clientNode) {
this.clientNode = clientNode;
}

public void setUseSiteFilters(boolean useSiteFilters) {
this.useSiteFilters = useSiteFilters;
}
Expand Down

0 comments on commit 9a50b38

Please sign in to comment.