summaryrefslogtreecommitdiff
path: root/src/main/java/com/p4square/groupsindexer/model
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2018-09-06 20:20:45 -0700
committerJesse Morgan <jesse@jesterpm.net>2018-09-06 20:20:45 -0700
commit87e7e2aa60ea5d02ef76477603d7f034d1a2f762 (patch)
tree450504f8c38f06ef5c172ecd430b3cd9eb9134b5 /src/main/java/com/p4square/groupsindexer/model
parent07538322208257974d0686753d27ee976ee1f7f1 (diff)
Add location, leader email, and campus search field
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;
}