summaryrefslogtreecommitdiff
path: root/src/main/java/com/p4square/groupsindexer/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/p4square/groupsindexer/model')
-rw-r--r--src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java24
-rw-r--r--src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java5
2 files changed, 27 insertions, 2 deletions
diff --git a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
index 5708c4f..3f32194 100644
--- a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
+++ b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
@@ -7,7 +7,7 @@ import java.util.HashMap;
import java.util.Map;
/**
- * A group description in ElasticSearch.
+ * A group description in the search results.
*/
public class GroupSearchDocument {
@@ -29,6 +29,12 @@ public class GroupSearchDocument {
@JsonProperty("leader-name")
private String leaderName;
+ @JsonProperty("leader-email")
+ private String leaderEmail;
+
+ @JsonProperty("location-city")
+ private String locationCity;
+
@JsonProperty("member-count")
private int currentMembers;
@@ -101,6 +107,22 @@ public class GroupSearchDocument {
this.leaderName = leaderName;
}
+ public String getLeaderEmail() {
+ return leaderEmail;
+ }
+
+ public void setLeaderEmail(String leaderEmail) {
+ this.leaderEmail = leaderEmail;
+ }
+
+ public String getLocationCity() {
+ return locationCity;
+ }
+
+ public void setLocationCity(String locationCity) {
+ this.locationCity = locationCity;
+ }
+
public String getImageUrl() {
return imageUrl;
}
diff --git a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java
index 2a9a089..744138a 100644
--- a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java
+++ b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java
@@ -19,6 +19,10 @@ public class GroupSearchDocumentAdapter implements Function<GroupProfile, GroupS
doc.setImageUrl(groupProfile.getImageUrl());
doc.setLeaderId(groupProfile.getMainLeader().getId());
doc.setLeaderName(groupProfile.getMainLeader().getFullName());
+ doc.setLeaderEmail(groupProfile.getMainLeader().getEmail());
+ if (groupProfile.getAddresses().size() > 0) {
+ doc.setLocationCity(groupProfile.getAddresses().get(0).getCity());
+ }
doc.setCurrentMembers(groupProfile.getCurrentMembers());
doc.setGroupCapacity(groupProfile.getGroupCapacity());
doc.setChildcareProvided(groupProfile.isChildcareProvided());
@@ -39,7 +43,6 @@ public class GroupSearchDocumentAdapter implements Function<GroupProfile, GroupS
doc.getCustomFields().put(field.getName(), ref);
}
-
return doc;
}