Package org.elasticsearch.common.xcontent

Examples of org.elasticsearch.common.xcontent.XContentBuilder.endObject()


      throws IOException {
    XContentBuilder builder = jsonBuilder().startObject();
    if (spaceKey != null)
      builder.field("spaceKey", spaceKey);
    builder.field("propertyName", propertyName).field(STORE_FIELD_VALUE, DateTimeUtils.formatISODateTime(datetime));
    builder.endObject();
    return builder;
  }

  @Override
  public Date readDatetimeValue(String spaceKey, String propertyName) throws IOException {
View Full Code Here


      if (comments != null && !comments.isEmpty()) {
        out.startArray(indexFieldForComments);
        for (Map<String, Object> comment : comments) {
          out.startObject();
          addCommonFieldsToCommentIndexedDocument(out, documentId, comment);
          out.endObject();
        }
        out.endArray();
      }
    }
    return out.endObject();
View Full Code Here

          out.endObject();
        }
        out.endArray();
      }
    }
    return out.endObject();
  }

  /**
   * Convert remote system's returned data into JSON document to be stored in search index for comments in child and
   * standalone mode.
View Full Code Here

    XContentBuilder out = jsonBuilder().startObject();
    addValueToTheIndexField(out, indexFieldForRiverName, riverName);
    addValueToTheIndexField(out, indexFieldForSpaceKey, spaceKey);
    addValueToTheIndexField(out, indexFieldForRemoteDocumentId, documentId);
    addCommonFieldsToCommentIndexedDocument(out, documentId, comment);
    return out.endObject();
  }

  private void addCommonFieldsToCommentIndexedDocument(XContentBuilder out, String documentId,
      Map<String, Object> comment) throws Exception {
    for (String indexFieldName : commentFieldsConfig.keySet()) {
View Full Code Here

              }

              XContentBuilder builder = restChannel.newBuilder();
              builder.startObject();
              builder.field("river_names", allRivers);
              builder.endObject();
              restChannel.sendResponse(new BytesRestResponse(RestStatus.OK, builder));
            } catch (Exception e) {
              onFailure(e);
            }
          }
View Full Code Here

   */
  public static XContentBuilder buildMessageDocument(RestRequest restRequest, String message) throws IOException {
    XContentBuilder builder = RestXContentBuilder.restContentBuilder(restRequest);
    builder.startObject();
    builder.field("message", message);
    builder.endObject();
    return builder;
  }

}
View Full Code Here

    builder.field("state", closed ? "stopped" : "running");
    if (!closed)
      builder.field("last_restart", lastRestartDate);
    else if (permanentStopDate != null)
      builder.field("stopped_permanently", permanentStopDate);
    builder.endObject();
    if (esNode != null) {
      builder.startObject("node");
      builder.field("id", esNode.getId());
      builder.field("name", esNode.getName());
      builder.endObject();
View Full Code Here

    builder.endObject();
    if (esNode != null) {
      builder.startObject("node");
      builder.field("id", esNode.getId());
      builder.field("name", esNode.getName());
      builder.endObject();
    }
    if (coordinatorInstance != null) {
      List<ProjectIndexingInfo> currProjectIndexingInfo = coordinatorInstance.getCurrentProjectIndexingInfo();
      if (currProjectIndexingInfo != null) {
        builder.startArray("current_indexing");
View Full Code Here

        ProjectIndexingInfo lastIndexing = getLastProjectIndexingInfo(projectKey);
        if (lastIndexing != null) {
          builder.field("last_indexing");
          lastIndexing.buildDocument(builder, false, true);
        }
        builder.endObject();
      }
      builder.endArray();
    }
    builder.endObject();
    return builder.string();
View Full Code Here

        }
        builder.endObject();
      }
      builder.endArray();
    }
    builder.endObject();
    return builder.string();
  }

  /**
   * @param projectKey to get info for
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.