Package org.elasticsearch.common.jackson.core

Examples of org.elasticsearch.common.jackson.core.JsonFactory


  private <T> T mapEntity(Collection<SearchHitField> values, Class<T> clazz) {
    return mapEntity(buildJSONFromFields(values), clazz);
  }

  private String buildJSONFromFields(Collection<SearchHitField> values) {
    JsonFactory nodeFactory = new JsonFactory();
    try {
      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      JsonGenerator generator = nodeFactory.createGenerator(stream, JsonEncoding.UTF8);
      generator.writeStartObject();
      for (SearchHitField value : values) {
        if (value.getValues().size() > 1) {
          generator.writeArrayFieldStart(value.getName());
          for (Object val : value.getValues()) {
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.jackson.core.JsonFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.