summaryrefslogtreecommitdiff
path: root/src/main/java/com/p4square/groupsindexer/model
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2018-08-04 16:23:03 -0700
committerJesse Morgan <jesse@jesterpm.net>2018-08-04 16:23:03 -0700
commit86665e59f0269d1e41ac88fba41a9099c454be6a (patch)
tree19caf3a8e0c36230dfbe09f4be049d3f5b1dd308 /src/main/java/com/p4square/groupsindexer/model
parent672c4709bba91cd58caacb47b006fb19bab646f6 (diff)
Dropping ElasticSearch in favor a single data file
The entire dataset is fairly small (116 kB), so I'm dropping the ElasticSearch cluster in favor of just writing the whole dataset into a file in S3. This lambda will run every 15 minutes and the client side will pull it down and filter the results.
Diffstat (limited to 'src/main/java/com/p4square/groupsindexer/model')
-rw-r--r--src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java11
-rw-r--r--src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java1
-rw-r--r--src/main/java/com/p4square/groupsindexer/model/GroupsCollection.java44
3 files changed, 44 insertions, 12 deletions
diff --git a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
index e336cb8..5708c4f 100644
--- a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
+++ b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocument.java
@@ -29,9 +29,6 @@ public class GroupSearchDocument {
@JsonProperty("leader-name")
private String leaderName;
- @JsonProperty("leader-email")
- private String leaderEmail;
-
@JsonProperty("member-count")
private int currentMembers;
@@ -104,14 +101,6 @@ public class GroupSearchDocument {
this.leaderName = leaderName;
}
- public String getLeaderEmail() {
- return leaderEmail;
- }
-
- public void setLeaderEmail(String leaderEmail) {
- this.leaderEmail = leaderEmail;
- }
-
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 ebe852d..2a9a089 100644
--- a/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java
+++ b/src/main/java/com/p4square/groupsindexer/model/GroupSearchDocumentAdapter.java
@@ -19,7 +19,6 @@ 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());
doc.setCurrentMembers(groupProfile.getCurrentMembers());
doc.setGroupCapacity(groupProfile.getGroupCapacity());
doc.setChildcareProvided(groupProfile.isChildcareProvided());
diff --git a/src/main/java/com/p4square/groupsindexer/model/GroupsCollection.java b/src/main/java/com/p4square/groupsindexer/model/GroupsCollection.java
new file mode 100644
index 0000000..de14239
--- /dev/null
+++ b/src/main/java/com/p4square/groupsindexer/model/GroupsCollection.java
@@ -0,0 +1,44 @@
+package com.p4square.groupsindexer.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.time.Instant;
+import java.util.List;
+
+/**
+ * A list of groups and some metadata.
+ */
+public class GroupsCollection {
+ @JsonProperty("last-updated")
+ private Instant lastUpdated;
+
+ @JsonProperty("groups")
+ private List<GroupSearchDocument> groups;
+
+ @JsonProperty("search-fields")
+ private List<SearchField> searchFields;
+
+ public Instant getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(Instant lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ public List<GroupSearchDocument> getGroups() {
+ return groups;
+ }
+
+ public void setGroups(List<GroupSearchDocument> groups) {
+ this.groups = groups;
+ }
+
+ public List<SearchField> getSearchFields() {
+ return searchFields;
+ }
+
+ public void setSearchFields(List<SearchField> searchFields) {
+ this.searchFields = searchFields;
+ }
+}