Skip to content

Commit

Permalink
[ML] Remove deprecated sort from reindex operation (elastic#117606)
Browse files Browse the repository at this point in the history
Sort in reindex is deprecated. This PR removes its use from within the reindexing step of dataframe analytics.

Testing indicates that having the destination index sorted is a "nice to have" and not necessary for the DFA functionality to succeed.
  • Loading branch information
edsavage authored Nov 28, 2024
1 parent 8350ff2 commit 2895f1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/117606.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 117606
summary: Remove deprecated sort from reindex operation within dataframe analytics procedure
area: Machine Learning
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.index.mapper.SeqNoFieldMapper;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.BulkByScrollTask;
import org.elasticsearch.index.reindex.ReindexAction;
import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.script.Script;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.tasks.TaskCancelledException;
import org.elasticsearch.tasks.TaskId;
Expand Down Expand Up @@ -147,7 +145,6 @@ protected void doExecute(ActionListener<StepResponse> listener) {
reindexRequest.setSourceQuery(config.getSource().getParsedQuery());
reindexRequest.getSearchRequest().allowPartialSearchResults(false);
reindexRequest.getSearchRequest().source().fetchSource(config.getSource().getSourceFiltering());
reindexRequest.getSearchRequest().source().sort(SeqNoFieldMapper.NAME, SortOrder.ASC);
reindexRequest.setDestIndex(config.getDest().getIndex());

// We explicitly set slices to 1 as we cannot parallelize in order to have the incremental id
Expand Down

0 comments on commit 2895f1e

Please sign in to comment.