...
 
......@@ -242,7 +242,7 @@ public class DocStatService extends AbstractService {
DocStatDao.OLD_INDEX, DocStatDao.OLD_TYPE, DocStatDao.INDEX, DocStatDao.TYPE));
int size = Math.min(1000, pluginSettings.getIndexBulkSize());
long now = System.currentTimeMillis()/1000;
long now = System.currentTimeMillis();
BulkRequestBuilder bulkRequest = client.prepareBulk();
SearchRequestBuilder searchRequest = client.prepareSearch(DocStatDao.OLD_INDEX)
......@@ -264,7 +264,9 @@ public class DocStatService extends AbstractService {
scrollId = response.getScrollId();
}
else {
response = client.prepareSearchScroll(scrollId).get();
response = client.prepareSearchScroll(scrollId)
.setScroll("1m")
.get();
}
// Read response
......@@ -284,9 +286,11 @@ public class DocStatService extends AbstractService {
}
}
// Flush the bulk if not empty
client.flushBulk(bulkRequest);
bulkRequest = client.prepareBulk();
// Flush the bulk if need
if (bulkRequest.numberOfActions() % size == 0) {
client.flushBulk(bulkRequest);
bulkRequest = client.prepareBulk();
}
// Prepare next iteration
from += size;
......
......@@ -71,7 +71,7 @@ public class SynchroGroupCommentAction extends AbstractSynchroUserAction {
// Check issuer has a user profile
if (client.isDocumentExists(GroupIndexDao.INDEX, GroupRecordDao.TYPE, recordId)) {
throw new UserProfileNotFoundException(String.format("Comment on an unknown page {%}.", recordId));
throw new UserProfileNotFoundException(String.format("Comment on an unknown page {%s}.", recordId));
}
}
}
......@@ -69,7 +69,7 @@ public class SynchroPageCommentAction extends AbstractSynchroUserAction {
// Check issuer has a user profile
if (client.isDocumentExists(PageIndexDao.INDEX, PageRecordDao.TYPE, recordId)) {
throw new UserProfileNotFoundException(String.format("Comment on an unknown page {%}.", recordId));
throw new UserProfileNotFoundException(String.format("Comment on an unknown page {%s}.", recordId));
}
}
}