Examples of ElasticSearchException


Examples of org.elasticsearch.ElasticsearchException

  @Override
  public void executeESBulkRequest(BulkRequestBuilder esBulk) throws Exception {
    BulkResponse response = esBulk.execute().actionGet();
    if (response.hasFailures()) {
      throw new ElasticsearchException("Failed to execute ES index bulk update: " + response.buildFailureMessage());
    }
  }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

      boundAddress = new BoundTransportAddress(
          new InetSocketTransportAddress(bindAddress),
          new InetSocketTransportAddress(publishAddress));

    } catch (final Exception e) {
      throw new ElasticsearchException("Unable to start Tomcat", e);
    }

  }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

      if (tomcat != null) {
        tomcat.stop();
      }

    } catch (final Exception e) {
      throw new ElasticsearchException("Unable to stop Tomcat", e);
    }

  }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

  protected void doClose() throws ElasticsearchException {
    try {
      tomcat.destroy();
      tomcat = null;
    } catch (final LifecycleException e) {
      throw new ElasticsearchException("Unable to destroy Tomcat", e);
    }

  }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

        // Fail if host address is a public IP but only on-site networking is allowed.
        if (onsiteonly) {
            if (hostAddress == null || (!hostAddress.isLoopbackAddress()
                    && !hostAddress.isLinkLocalAddress()
                    && !hostAddress.isSiteLocalAddress())) {
                throw new ElasticsearchException("Bind host " + bindHost
                        + (hostAddress != null ? "(address " + hostAddress + ") " : "")
                        + "is not on-site and not permitted by default. Check 'websocket.onsiteonly' setting in configuration.");
            }
        }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

        Class<? extends TypeSelector> typeSelectorClass = settings.<TypeSelector>getAsClass("couchbase.typeSelector", DefaultTypeSelector.class);
        try {
            this.typeSelector = typeSelectorClass.newInstance();
        } catch (Exception e) {
            throw new ElasticsearchException("couchbase.typeSelector", e);
        }
        this.typeSelector.configure(settings);


        int defaultNumVbuckets = 1024;
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

    protected void doStop() throws ElasticsearchException {
        if(server != null) {
            try {
                server.stop();
            } catch (Exception e) {
                throw new ElasticsearchException("Error stopping jetty", e);
            }
        }
    }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

            if (Version.CURRENT.before(Version.V_1_2_4)) {
                throw new Exception();
            }
        } catch (Throwable e) {
            String error = String.format(Locale.ROOT, "The elasticsearch suggest plugin needs a newer version of elasticsearch than %s", Version.CURRENT);
            throw new ElasticsearchException(error);
        }
    }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

    public ShardSuggestResponse suggest(ShardSuggestRequest shardSuggestRequest) {
        List<String> suggestions;
        try {
            suggestions = Lists.newArrayList(getSuggestions(shardSuggestRequest));
        } catch (IOException e) {
            throw new ElasticsearchException("Error getting suggestions", e);
        }
        return new ShardSuggestResponse(shardId.index().name(), shardId.id(), suggestions);
    }
View Full Code Here

Examples of org.elasticsearch.ElasticsearchException

            queryAnalyzer = fieldMapper.searchAnalyzer();
            if (Strings.hasLength(fieldType.indexAnalyzer())) {
                NamedAnalyzer namedAnalyzer = analysisService.analyzer(fieldType.queryAnalyzer());
                if (namedAnalyzer == null) {
                    throw new ElasticsearchException("Query analyzer[" + fieldType.queryAnalyzer() + "] does not exist.");
                }
                queryAnalyzer = namedAnalyzer.analyzer();
            }

            indexAnalyzer = fieldMapper.searchAnalyzer();
            if (Strings.hasLength(fieldType.indexAnalyzer())) {
                NamedAnalyzer namedAnalyzer = analysisService.analyzer(fieldType.indexAnalyzer());
                if (namedAnalyzer == null) {
                    throw new ElasticsearchException("Index analyzer[" + fieldType.indexAnalyzer() + "] does not exist.");
                }
                indexAnalyzer = namedAnalyzer.analyzer();
            }
        }
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.