org.elasticsearch.action.admin.indices.get.GetIndexRequest.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(1161)

本文整理了Java中org.elasticsearch.action.admin.indices.get.GetIndexRequest.<init>()方法的一些代码示例,展示了GetIndexRequest.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GetIndexRequest.<init>()方法的具体详情如下:
包路径:org.elasticsearch.action.admin.indices.get.GetIndexRequest
类名称:GetIndexRequest
方法名:<init>

GetIndexRequest.<init>介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

public List<String> getIndices(ElasticsearchTableDescription tableDescription)
{
  if (tableDescription.getIndexExactMatch()) {
    return ImmutableList.of(tableDescription.getIndex());
  }
  TransportClient client = clients.get(tableDescription.getClusterName());
  verify(client != null, "client is null");
  String[] indices = getIndices(client, new GetIndexRequest());
  return Arrays.stream(indices)
        .filter(index -> index.startsWith(tableDescription.getIndex()))
        .collect(toImmutableList());
}

代码示例来源:origin: spring-projects/spring-data-elasticsearch

@Override
public boolean indexExists(String indexName) {
  GetIndexRequest request = new GetIndexRequest();
  request.indices(indexName);
  try {
    return client.indices().exists(request);
  } catch (IOException e) {
    throw new ElasticsearchException("Error while for indexExists request: " + request.toString(), e);
  }
}

代码示例来源:origin: floragunncom/search-guard

sgIndex = tc.admin().indices().getIndex(new GetIndexRequest().indices(index).addFeatures(Feature.MAPPINGS)).actionGet();
} catch (IndexNotFoundException e1) {

代码示例来源:origin: apache/usergrid

ActionFuture<GetIndexResponse> responseFuture = provider.getClient().admin().indices().getIndex(new GetIndexRequest());
Observable
  .from(responseFuture)

代码示例来源:origin: org.elasticsearch/elasticsearch

public GetIndexRequestBuilder(ElasticsearchClient client, GetIndexAction action, String... indices) {
  super(client, action, new GetIndexRequest().indices(indices));
}

代码示例来源:origin: dadoonet/fscrawler

/**
 * Check if an index exists
 * @param index index name
 * @return true if the index exists, false otherwise
 * @throws IOException In case of error
 */
public boolean isExistingIndex(String index) throws IOException {
  logger.debug("is existing index [{}]", index);
  GetIndexRequest gir = new GetIndexRequest();
  gir.indices(index);
  return client.indices().exists(gir, RequestOptions.DEFAULT);
}

代码示例来源:origin: dadoonet/fscrawler

/**
 * Check if an index exists
 * @param index index name
 * @return true if the index exists, false otherwise
 * @throws IOException In case of error
 */
public boolean isExistingIndex(String index) throws IOException {
  logger.debug("is existing index [{}]", index);
  GetIndexRequest gir = new GetIndexRequest();
  gir.indices(index);
  return client.indices().exists(gir, RequestOptions.DEFAULT);
}

代码示例来源:origin: tomoya92/pybbs

public boolean existIndex() {
 try {
  if (this.instance() == null) return false;
  GetIndexRequest request = new GetIndexRequest();
  request.indices(name);
  request.local(false);
  request.humanReadable(true);
  return client.indices().exists(request, RequestOptions.DEFAULT);
 } catch (IOException e) {
  log.error(e.getMessage());
  return false;
 }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
  final GetIndexRequest getIndexRequest = new GetIndexRequest();
  getIndexRequest.indices(indices);
  getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions()));
  getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local()));
  getIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexRequest.masterNodeTimeout()));
  getIndexRequest.humanReadable(request.paramAsBoolean("human", false));
  getIndexRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
  return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  final GetIndexRequest getIndexRequest = new GetIndexRequest();
  getIndexRequest.indices(Strings.EMPTY_ARRAY);
  getIndexRequest.features(Feature.ALIASES);

代码示例来源:origin: apache/servicemix-bundles

public GetIndexRequestBuilder(ElasticsearchClient client, GetIndexAction action, String... indices) {
  super(client, action, new GetIndexRequest().indices(indices));
}

代码示例来源:origin: Yirendai/cicada

private List<String> getAllIndice() {
  final List<String> indice = new LinkedList<String>();
  final GetIndexResponse resp = client.admin().indices().getIndex(new GetIndexRequest()).actionGet();

  for (final String indexName : resp.indices()) {
   if (indexName.startsWith(props.getEsSpanIndexPrefix()) //
     || indexName.startsWith(props.getEsAnnotationIndexPrefix())) {
    indice.add(indexName);
   }
  }

  return indice;
 }
}

代码示例来源:origin: apache/metamodel

public Set<Entry<String, Object>> getMappings(final String indexName, final Header... headers) throws IOException {
  return performRequestAndParseEntity(new GetIndexRequest(), request -> getMappings(indexName), (
      response) -> parseMappings(response, indexName), emptySet(), headers);
}

代码示例来源:origin: SeaseLtd/rated-ranking-evaluator

/**
 * Check whether or not an index exists.
 *
 * @param index the name of the index to check.
 * @return {@code true} if the index exists.
 * @throws IOException if a problem occurs calling the server.
 */
public boolean indexExists(String index) throws IOException {
  return client.indices().exists(new GetIndexRequest().indices(index));
}

代码示例来源:origin: dqeasycloud/easy-cloud

public boolean existsIndex(String indexName, String type) throws IOException {
  try {
    GetIndexRequest request = new GetIndexRequest();
    request.indices(indexName);
    return client.indices().exists(request);
  } catch (ElasticsearchException exception) {
    if (exception.status() == RestStatus.NOT_FOUND) {
    }
  }
  return false;
}

代码示例来源:origin: harbby/presto-connectors

private static GetIndexRequest createGetIndexRequest(String index)
  {
    return new GetIndexRequest()
        .local(true)
        .indices(index)
        .features(GetIndexRequest.Feature.MAPPINGS)
        //lenient because we throw our own errors looking at the response e.g. if something was not resolved
        //also because this way security doesn't throw authorization exceptions but rather honours ignore_unavailable
        .indicesOptions(IndicesOptions.lenientExpandOpen());
  }
}

代码示例来源:origin: harbby/presto-connectors

private static GetIndexRequest createGetIndexRequest(String index)
  {
    return new GetIndexRequest()
        .local(true)
        .indices(index)
        .features(GetIndexRequest.Feature.MAPPINGS)
        //lenient because we throw our own errors looking at the response e.g. if something was not resolved
        //also because this way security doesn't throw authorization exceptions but rather honours ignore_unavailable
        .indicesOptions(IndicesOptions.lenientExpandOpen());
  }
}

代码示例来源:origin: harbby/presto-connectors

private static GetIndexRequest createGetIndexRequest(String index)
  {
    return new GetIndexRequest()
        .local(true)
        .indices(index)
        .features(GetIndexRequest.Feature.MAPPINGS)
        //lenient because we throw our own errors looking at the response e.g. if something was not resolved
        //also because this way security doesn't throw authorization exceptions but rather honours ignore_unavailable
        .indicesOptions(IndicesOptions.lenientExpandOpen());
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
  final GetIndexRequest getIndexRequest = new GetIndexRequest();
  getIndexRequest.indices(indices);
  getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions()));
  getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local()));
  getIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexRequest.masterNodeTimeout()));
  getIndexRequest.humanReadable(request.paramAsBoolean("human", false));
  getIndexRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
  return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel));
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
  final GetIndexRequest getIndexRequest = new GetIndexRequest();
  getIndexRequest.indices(indices);
  getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions()));
  getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local()));
  getIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexRequest.masterNodeTimeout()));
  getIndexRequest.humanReadable(request.paramAsBoolean("human", false));
  getIndexRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
  return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel));
}

相关文章