building search response should handle cases where the sort is null valued
This commit is contained in:
parent
8cce3d6cce
commit
b9b91db5c8
|
@ -462,6 +462,9 @@ public final class XContentBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public XContentBuilder value(Object value) throws IOException {
|
public XContentBuilder value(Object value) throws IOException {
|
||||||
|
if (value == null) {
|
||||||
|
return nullValue();
|
||||||
|
}
|
||||||
Class type = value.getClass();
|
Class type = value.getClass();
|
||||||
if (type == String.class) {
|
if (type == String.class) {
|
||||||
value((String) value);
|
value((String) value);
|
||||||
|
|
|
@ -97,6 +97,9 @@ public class RestSearchAction extends BaseRestHandler {
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug("failed to execute search (building response)", e);
|
||||||
|
}
|
||||||
onFailure(e);
|
onFailure(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue