org.elasticsearch.rest.XContentRestResponse类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(121)

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

XContentRestResponse介绍

暂无

代码示例

代码示例来源:origin: jprante/elasticsearch-gatherer

@Override
public void onResponse(DeployResponse deployNodeResponses) {
  try {
    final XContentBuilder builder = restContentBuilder(request);
    builder.startObject()
        .field("deploy", true)
        .endObject();
    channel.sendResponse(new XContentRestResponse(request, OK, builder));
  } catch (Exception e) {
    onFailure(e);
  }
}

代码示例来源:origin: bleskes/elasticfacets

@Override
public void onResponse(CacheStatsPerFieldResponse response) {
  try {
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
    builder.startObject();
    response.toXContent(builder, request);
    builder.endObject();
    channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
  } catch (Exception e) {
    onFailure(e);
  }
}

代码示例来源:origin: crate/elasticsearch-inout-plugin

public void onResponse(SearchIntoResponse response) {
  try {
    XContentBuilder builder = RestXContentBuilder
        .restContentBuilder(
            request);
    response.toXContent(builder, request);
    channel.sendResponse(new XContentRestResponse(
        request, OK, builder));
  } catch (Exception e) {
    onFailure(e);
  }
}

代码示例来源:origin: crate/elasticsearch-inout-plugin

public void onResponse(ExportResponse response) {
  try {
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
    response.toXContent(builder, request);
    channel.sendResponse(new XContentRestResponse(request, OK, builder));
  } catch (Exception e) {
    onFailure(e);
  }
}

代码示例来源:origin: crate/elasticsearch-inout-plugin

public void onResponse(ImportResponse response) {
  try {
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
    response.toXContent(builder, request);
    channel.sendResponse(new XContentRestResponse(request, OK, builder));
  } catch (Exception e) {
    onFailure(e);
  }
}

代码示例来源:origin: karussell/elasticsearch-rollindex

builder.field("error", "indexPrefix missing");
    builder.endObject();
    channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder));
    return;
  channel.sendResponse(new XContentRestResponse(request, OK, builder));
} catch (IOException ex) {
  try {

代码示例来源:origin: medcl/elasticsearch-carrot2

channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
} catch (IOException e1) {
  logger.error("Failed to send failure response", e1);
    channel.sendResponse(new XContentRestResponse(request, response.status(), builder));
  } catch (Exception e) {
    if (logger.isDebugEnabled()) {

代码示例来源:origin: crate/elasticsearch-inout-plugin

try {
  XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
  channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
} catch (IOException e1) {
  logger.error("Failed to send failure response", e1);
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
    response.toXContent(builder, request);
    channel.sendResponse(new XContentRestResponse(request, OK, builder));
  } catch (Exception e) {
    onFailure(e);

代码示例来源:origin: medcl/elasticsearch-carrot2

channel.sendResponse(new XContentRestResponse(request, response.status(), builder));
} catch (Exception e) {
  if (logger.isDebugEnabled()) {

代码示例来源:origin: medcl/elasticsearch-partialupdate

.endObject();
channel.sendResponse(new XContentRestResponse(request,
    RestStatus.BAD_REQUEST, builder));
return;
  getResponse.toXContent(builder, request);
  if (!getResponse.isExists()) {
    channel.sendResponse(new XContentRestResponse(request,
        NOT_FOUND, builder));
  } else {
                  status = CREATED;
                channel.sendResponse(new XContentRestResponse(
                    request, status,
                    builder));
          .field("reason", "source is empty")
          .endObject();
      channel.sendResponse(new XContentRestResponse(
          request, RestStatus.BAD_REQUEST, builder));

代码示例来源:origin: medcl/elasticsearch-partialupdate

getResponse.toXContent(builder, request);
if (!getResponse.isExists()) {
  channel.sendResponse(new XContentRestResponse(request,
      NOT_FOUND, builder));
} else {
        .field("reason", "source is empty")
        .endObject();
    channel.sendResponse(new XContentRestResponse(
        request, RestStatus.BAD_REQUEST, builder));

代码示例来源:origin: crate/elasticsearch-inout-plugin

try {
  XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
  channel.sendResponse(new XContentRestResponse(request, BAD_REQUEST, builder.startObject().field("error", e.getMessage()).endObject()));
} catch (IOException e1) {
  logger.error("Failed to send failure response", e1);
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
    response.toXContent(builder, request);
    channel.sendResponse(new XContentRestResponse(request, OK, builder));
  } catch (Exception e) {
    onFailure(e);

代码示例来源:origin: crate/elasticsearch-inout-plugin

.restContentBuilder(
        request);
channel.sendResponse(new XContentRestResponse(request,
    BAD_REQUEST, builder.startObject().field("error",
    e.getMessage()).endObject()));
              request);
      response.toXContent(builder, request);
      channel.sendResponse(new XContentRestResponse(
          request, OK, builder));
    } catch (Exception e) {

相关文章

XContentRestResponse类方法