building search response should handle cases where the sort is null valued

This commit is contained in:
kimchy 2010-09-21 22:13:27 +02:00
parent 8cce3d6cce
commit b9b91db5c8
2 changed files with 6 additions and 0 deletions

View File

@ -462,6 +462,9 @@ public final class XContentBuilder {
}
public XContentBuilder value(Object value) throws IOException {
if (value == null) {
return nullValue();
}
Class type = value.getClass();
if (type == String.class) {
value((String) value);

View File

@ -97,6 +97,9 @@ public class RestSearchAction extends BaseRestHandler {
builder.endObject();
channel.sendResponse(new XContentRestResponse(request, OK, builder));
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("failed to execute search (building response)", e);
}
onFailure(e);
}
}