@Override public void writeTo(StreamOutput out) throws IOException { if (query != null) { out.writeBoolean(true); Symbol.toStream(query, out); } else { out.writeBoolean(false); out.writeBoolean(noMatch); } }