コード例 #1
0
  private static SolrInputDocument toSolr(SeadEvent event) {
    SolrInputDocument doc = new SolrInputDocument();

    add(doc, EntityField.ID, event.getId());
    add(doc, EntityField.TYPE, EntityTypeValue.EVENT.solrValue());
    add(doc, EventField.DATE, event.getDate());
    add(doc, EventField.DETAIL, event.getDetail());
    add(doc, EventField.OUTCOME, event.getOutcome());
    add(doc, EventField.TYPE, event.getEventType());
    addResourceIdentifierSet(doc, event.getAlternateIds());

    addRefSet(doc, event.getTargets(), EventField.TARGET);

    if (event.getLogDetail() != null) {
      SeadLogDetail log = event.getLogDetail();
      add(doc, SeadSolrField.DetailLogField.IPADDRESS, log.getIpAddress());
      add(doc, SeadSolrField.DetailLogField.USERAGENT, log.getUserAgent());
      add(doc, SeadSolrField.DetailLogField.SUBJECT, log.getSubject());
      add(doc, SeadSolrField.DetailLogField.NODEIDENTIFIER, log.getNodeIdentifier());
    }

    return doc;
  }