@Override public void writeTo(StreamOutput out) throws IOException { hits.writeTo(out); if (facets == null) { out.writeBoolean(false); } else { out.writeBoolean(true); facets.writeTo(out); } out.writeBoolean(timedOut); }