Skip to content

Commit

Permalink
Fix rollup search statistics (#36674)
Browse files Browse the repository at this point in the history
This change fixes the rollup statistics regarding search times. Search times are
computed from the first query and never updated. This commit adds the missing
calls to the subsequent search.
  • Loading branch information
jimczi authored and polyfractal committed Dec 18, 2018
1 parent 74502d7 commit f05c404
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ private void onBulkResponse(BulkResponse response, JobPosition position) {
ActionListener<SearchResponse> listener = ActionListener.wrap(this::onSearchResponse, this::finishWithSearchFailure);
// TODO probably something more intelligent than every-50 is needed
if (stats.getNumPages() > 0 && stats.getNumPages() % 50 == 0) {
doSaveState(IndexerState.INDEXING, position, () -> doNextSearch(buildSearchRequest(), listener));
doSaveState(IndexerState.INDEXING, position, () -> {
stats.markStartSearch();
doNextSearch(buildSearchRequest(), listener);
});
} else {
stats.markStartSearch();
doNextSearch(buildSearchRequest(), listener);
}
} catch (Exception e) {
Expand Down

0 comments on commit f05c404

Please sign in to comment.