use of teammates.storage.search.InstructorSearchDocument in project teammates by TEAMMATES.
the class InstructorsDb method putDocuments.
/**
* Batch creates or updates documents for the given instructors.
*/
public void putDocuments(List<InstructorAttributes> instructorParams) {
List<SearchDocument> instructorDocuments = new ArrayList<>();
for (InstructorAttributes instructor : instructorParams) {
if (instructor.key == null) {
instructor = this.getInstructorForEmail(instructor.courseId, instructor.email);
}
// defensive coding for legacy data
if (instructor.key != null) {
instructorDocuments.add(new InstructorSearchDocument(instructor));
}
}
putDocuments(Const.SearchIndex.INSTRUCTOR, instructorDocuments);
}
Aggregations