Package org.elasticsearch.node

Examples of org.elasticsearch.node.NodeBuilder.node()


    public Node buildNode() {
        NodeBuilder builder = nodeBuilder().local(isLocal()).data(isData());
        if (!isLocal() && getClusterName() != null) {
            builder.clusterName(getClusterName());
        }
        return builder.node();
    }

    private boolean isValidAuthority() throws URISyntaxException {
        if (authority.contains(":")) {
            return false;
View Full Code Here


    public Node buildNode() {
        NodeBuilder builder = nodeBuilder().local(isLocal()).data(isData());
        if (!isLocal() && getClusterName() != null) {
            builder.clusterName(getClusterName());
        }
        return builder.node();
    }

    private boolean isValidAuthority() throws URISyntaxException {
        if (authority.contains(":")) {
            return false;
View Full Code Here

  public static void main(String[] args) {
    NodeBuilder nb = NodeBuilder.nodeBuilder();

    nb.local(true);
    nb.settings(ImmutableSettings.settingsBuilder().loadFromClasspath("elasticsearch.yml"));
    nb.node();

    while (true) {
      try {
        Thread.currentThread().sleep(60000);
      } catch (Exception e) {
View Full Code Here

    if (null != settings) {
      nodeBuilder.getSettings().put(settings);
    }

    node = nodeBuilder.node();
  }

  private void internalLoadSettings(final NodeBuilder nodeBuilder, final Resource configLocation) {

    try {
View Full Code Here

  // 1. Link to client (or cluster)
     
    if (_bLocalMode) {
      NodeBuilder nBuilder = NodeBuilder.nodeBuilder().local(true);
      if (null == _elasticClient) {
        _elasticClient = new CrossVersionClient(nBuilder.node().client());
      }
    }
    else if (bRemote) {
     
      if (null == _elasticClient) {
View Full Code Here

  // 1. Link to client (or cluster)
     
    if (_bLocalMode) {
      NodeBuilder nBuilder = NodeBuilder.nodeBuilder().local(true);
      if (null == _elasticClient) {
        _elasticClient = new CrossVersionClient(nBuilder.node().client());
      }
    }
    else if (bRemote) {
     
      if (null == _elasticClient) {
View Full Code Here

    @Bean
    public Client elasticSearchClient() throws Exception {
        NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().local(true);
        nodeBuilder.getSettings().put("network.host", "127.0.0.1");
        node = nodeBuilder.node();
        Client client = node.client();
        return client;
    }

    @PostConstruct
View Full Code Here

    public Node buildNode() {
        NodeBuilder builder = nodeBuilder().local(isLocal()).data(isData());
        if (!isLocal() && getClusterName() != null) {
            builder.clusterName(getClusterName());
        }
        return builder.node();
    }

    private boolean isValidAuthority() throws URISyntaxException {
        if (authority.contains(":")) {
            return false;
View Full Code Here

    // Check Model
    if (this.isLocalMode()) {
      Logger.info("Starting Elastic Search for Play! in Local Mode");
      final NodeBuilder nb = nodeBuilder().settings(settings).local(true).client(false).data(true);
      final Node node = nb.node();
      client = node.client();

    } else {
      Logger.info("Connecting Play! to Elastic Search in Client Mode");
      final TransportClient c = new TransportClient(settings);
View Full Code Here

    }

    NodeBuilder nBuilder = nodeBuilder().clusterName(clusterName).loadConfigSettings(true).
        settings(settings);

    esNode = nBuilder.node();
    log.info("started elastic search node");
    return this;
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.