本文整理了Java中org.elasticsearch.rest.XContentRestResponse
类的一些代码示例,展示了XContentRestResponse
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XContentRestResponse
类的具体详情如下:
包路径:org.elasticsearch.rest.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) {
内容来源于网络,如有侵权,请联系作者删除!