Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy constructor to SearchRequest #36641

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Dec 14, 2018

For cross cluster search alternate execution mode (see #32125) we will need to take a search request that spans across multiple clusters (based on index prefixes e.g. cluster1:index, cluster2:index etc.) and split it into multiple search requests to be sent to each cluster. A copy constructor added to SearchRequest would make that easy and well maintainable over time.

Something along the same lines already happens in BulkByScrollParallelizationHelper, but the corresponding code went outdated as some new fields were added to SearchRequest which were not added to the bulk by scroll code. A copy constructor should make the need of adjusting it more visible when adding new fields.

For cross cluster search execution mode (see elastic#32125), we will need to take a search request that spans across multiple clusters (based on index prefixes e.g. cluster1:index, cluster2:index etc.) and split it into multiple search requests to be sent to each cluster. A copy constructor added to SearchRequest would make that easy and well maintanable in the future.

Something along the same lines already happens in `BulkByScrollParallelizationHelper`, but the corresponding code went outdated as some new fields were added to `SearchRequest` which were not added to the bulk by scroll code. A copy constructor helps making the task of copying a search request maintainable over time.
@javanna javanna added >enhancement :Search/Search Search-related issues that do not fall into other categories v7.0.0 v6.6.0 labels Dec 14, 2018
@javanna javanna requested a review from nik9000 December 14, 2018 13:01
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

.indicesOptions(request.indicesOptions());
if (request.allowPartialSearchResults() != null) {
slices[slice].allowPartialSearchResults(request.allowPartialSearchResults());
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following fields were not copied:

    this.batchedReduceSize = searchRequest.batchedReduceSize;
    this.maxConcurrentShardRequests = searchRequest.maxConcurrentShardRequests;
    this.preFilterShardSize = searchRequest.preFilterShardSize;

They look recently added hence I assume this was just a mistake and they should be copied.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Thanks for fixing reindex!

@javanna javanna merged commit 8f04536 into elastic:master Dec 14, 2018
javanna added a commit to javanna/elasticsearch that referenced this pull request Dec 17, 2018
For cross cluster search alternate execution mode (see elastic#32125), we will need to take a search request that spans across multiple clusters (based on index prefixes e.g. cluster1:index, cluster2:index etc.) and split it into multiple search requests to be sent to each cluster. A copy constructor added to `SearchRequest` would make that easy and well maintainable in the future.

Something along the same lines already happens in `BulkByScrollParallelizationHelper`, but the corresponding code went outdated as some new fields were added to `SearchRequest` which were not added to the bulk by scroll code. A copy constructor helps making the task of copying a search request maintainable over time.
javanna added a commit to javanna/elasticsearch that referenced this pull request Dec 18, 2018
For cross cluster search alternate execution mode (see elastic#32125), we will need to take a search request that spans across multiple clusters (based on index prefixes e.g. cluster1:index, cluster2:index etc.) and split it into multiple search requests to be sent to each cluster. A copy constructor added to `SearchRequest` would make that easy and well maintainable in the future.

Something along the same lines already happens in `BulkByScrollParallelizationHelper`, but the corresponding code went outdated as some new fields were added to `SearchRequest` which were not added to the bulk by scroll code. A copy constructor helps making the task of copying a search request maintainable over time.
javanna added a commit to javanna/elasticsearch that referenced this pull request Dec 18, 2018
javanna added a commit to javanna/elasticsearch that referenced this pull request Dec 18, 2018
javanna added a commit that referenced this pull request Dec 18, 2018
For cross cluster search alternate execution mode (see #32125), we will need to take a search request that spans across multiple clusters (based on index prefixes e.g. cluster1:index, cluster2:index etc.) and split it into multiple search requests to be sent to each cluster. A copy constructor added to `SearchRequest` would make that easy and well maintainable in the future.

Something along the same lines already happens in `BulkByScrollParallelizationHelper`, but the corresponding code went outdated as some new fields were added to `SearchRequest` which were not added to the bulk by scroll code. A copy constructor helps making the task of copying a search request maintainable over time.
spinscale pushed a commit that referenced this pull request Dec 19, 2018
javanna added a commit that referenced this pull request Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants