org.elasticsearch.client.IndicesAdminClient.validateQuery()方法的使用及代码示例

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

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

IndicesAdminClient.validateQuery介绍

[英]Validate a query for correctness.
[中]验证查询的正确性。

代码示例

代码示例来源:origin: javanna/elasticshell

@Override
protected ActionFuture<ValidateQueryResponse> doExecute(ValidateQueryRequest request) {
  return client.admin().indices().validateQuery(request);
}

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

client.admin().indices().validateQuery(validateQueryRequest, new RestToXContentListener<>(channel));

代码示例来源:origin: com.github.cafdataprocessing/corepolicy-condition-engine

@Override
public void isValidExpression(String string) {
  try {
    XContentBuilder query = BooleanExpressionParser.wrapQuery(parseQuery(string));
    if (query != null) {
      initialize();
      ValidateQueryRequest validationRequest = new ValidateQueryRequest(policyIndexName)
          .source(query);
      validationRequest.explain(true);
      ValidateQueryResponse validationResponse = getElasticClient()
          .admin()
          .indices()
          .validateQuery(validationRequest)
          .actionGet(elasticsearchProperties.getElasticsearchSearchTimeout());
      if (!validationResponse.isValid()) {
        throw new RuntimeException(validationResponse
            .getQueryExplanation()
            .stream()
            .map(QueryExplanation::getError)
            .collect(Collectors.joining(System.getProperty("line.separator"))));
      }
    }
  } catch (IOException e) {
    throw new BackEndRequestFailedCpeException(e);
  }
}

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

client.admin().indices().validateQuery(validateQueryRequest, new RestBuilderListener<ValidateQueryResponse>(channel) {
  @Override
  public RestResponse buildResponse(ValidateQueryResponse response, XContentBuilder builder) throws Exception {

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

client.admin().indices().validateQuery(validateQueryRequest, new RestToXContentListener<>(channel));

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

client.admin().indices().validateQuery(validateQueryRequest, new RestToXContentListener<>(channel));

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

client.admin().indices().validateQuery(validateQueryRequest, new RestBuilderListener<ValidateQueryResponse>(channel) {
  @Override
  public RestResponse buildResponse(ValidateQueryResponse response, XContentBuilder builder) throws Exception {

相关文章

微信公众号

最新文章

更多

IndicesAdminClient类方法