@Override public SearchTotal deserialize(final JsonParser parser,
                                                               final DeserializationContext ctxt)
            throws IOException {

      JsonNode node = parser.getCodec().readTree(parser);
      return parseSearchTotal(node);
    }
Allows to de-serialize total hits structures.
criteria/elasticsearch/src/org/immutables/criteria/elasticsearch/Json.java