Package org.elasticsearch.common.xcontent

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


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

  @Override
  public Date readDatetimeValue(String projectKey, 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, issueKey, comment);
          out.endObject();
        }
        out.endArray();
      }
    }
    if (changelogIndexingMode == IssueCommentIndexingMode.EMBEDDED) {
View Full Code Here

      if (changelogs != null && !changelogs.isEmpty()) {
        out.startArray(indexFieldForChangelogs);
        for (Map<String, Object> changelog : changelogs) {
          out.startObject();
          addCommonFieldsToChangelogIndexedDocument(out, issueKey, changelog);
          out.endObject();
        }
        out.endArray();
      }
    }
    return out.endObject();
View Full Code Here

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

  /**
   * Convert JIRA returned REST 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, indexFieldForProjectKey, projectKey);
    addValueToTheIndexField(out, indexFieldForIssueKey, issueKey);
    addCommonFieldsToCommentIndexedDocument(out, issueKey, comment);
    return out.endObject();
  }

  private void addCommonFieldsToCommentIndexedDocument(XContentBuilder out, String issueKey, Map<String, Object> comment)
      throws Exception {
    addValueToTheIndexField(out, indexFieldForJiraURL, prepareJIRAGUIUrl(issueKey, extractCommentId(comment)));
View Full Code Here

    XContentBuilder out = jsonBuilder().startObject();
    addValueToTheIndexField(out, indexFieldForRiverName, riverName);
    addValueToTheIndexField(out, indexFieldForProjectKey, projectKey);
    addValueToTheIndexField(out, indexFieldForIssueKey, issueKey);
    addCommonFieldsToChangelogIndexedDocument(out, issueKey, changelog);
    return out.endObject();
  }

  private void addCommonFieldsToChangelogIndexedDocument(XContentBuilder out, String issueKey,
      Map<String, Object> changelog) throws Exception {
    addValueToTheIndexField(out, indexFieldForJiraURL, prepareJIRAGUIUrl(issueKey, null));
View Full Code Here

              }

              XContentBuilder builder = restChannel.newBuilder();
              builder.startObject();
              builder.field("jira_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<SpaceIndexingInfo> currProjectIndexingInfo = coordinatorInstance.getCurrentSpaceIndexingInfo();
      if (currProjectIndexingInfo != null) {
        builder.startArray("current_indexing");
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.