use of teammates.storage.search.FeedbackResponseCommentSearchDocument in project teammates by TEAMMATES.
the class DataMigrationForFeedbackResponseCommentSearchDocument method postAction.
/**
* {@inheritDoc}
*/
@Override
protected void postAction() {
if (isPreview()) {
return;
}
LoopHelper loopHelper = new LoopHelper(BATCH_SIZE, "documents processed.");
List<Document> documentsToUpdate = new ArrayList<>();
for (FeedbackResponseCommentAttributes comment : commentsToMigrate) {
loopHelper.recordLoop();
documentsToUpdate.add(new FeedbackResponseCommentSearchDocument(comment).build());
if (documentsToUpdate.size() == BATCH_SIZE) {
updateAndClearDocuments(documentsToUpdate);
}
}
updateAndClearDocuments(documentsToUpdate);
}
use of teammates.storage.search.FeedbackResponseCommentSearchDocument in project teammates by TEAMMATES.
the class FeedbackResponseCommentsDb method putDocuments.
/*
* Batch creates or updates search documents for the given comments
*/
public void putDocuments(List<FeedbackResponseCommentAttributes> comments) {
List<SearchDocument> frcSearchDocuments = new ArrayList<>();
for (FeedbackResponseCommentAttributes comment : comments) {
frcSearchDocuments.add(new FeedbackResponseCommentSearchDocument(comment));
}
putDocuments(Const.SearchIndex.FEEDBACK_RESPONSE_COMMENT, frcSearchDocuments);
}
Aggregations