Package org.elasticsearch.common.jackson.core

Examples of org.elasticsearch.common.jackson.core.JsonGenerator.writeStartObject()


  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()) {
            generator.writeObject(val);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.