Skip to content

Commit

Permalink
Merge pull request #693 from WildMeOrg/additional_search_fields
Browse files Browse the repository at this point in the history
add some additional fields to search api doc/results
  • Loading branch information
TanyaStere42 authored Aug 22, 2024
2 parents fcd3c07 + f0f51db commit ebc0869
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/ecocean/Encounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4434,11 +4434,19 @@ public void opensearchDocumentSerializer(JsonGenerator jgen)
jgen.writeString(name);
}
jgen.writeEndArray();
jgen.writeStringField("individualNickName", indiv.getNickName());
if (indiv.getTimeOfBirth() > 0) {
String birthTime = Util.getISO8601Date(new DateTime(
indiv.getTimeOfBirth()).toString());
jgen.writeStringField("individualTimeOfBirth", birthTime);
}
Encounter[] encs = indiv.getDateSortedEncounters(true);
if ((encs != null) && (encs.length > 0)) {
String encDate = Util.getISO8601Date(encs[0].getDate());
if (encDate != null) jgen.writeStringField("individualFirstEncounterDate", encDate);
encDate = Util.getISO8601Date(encs[encs.length - 1].getDate());
if (encDate != null) jgen.writeStringField("individualLastEncounterDate", encDate);
}
/*
this currently is not needed as-is. we instead use just the social unit name as its own property (below)
Expand Down

0 comments on commit ebc0869

Please sign in to comment.