Skip to content

Clean up adjustSearchType method #96334

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

Merged
merged 2 commits into from
May 25, 2023
Merged

Clean up adjustSearchType method #96334

merged 2 commits into from
May 25, 2023

Conversation

jdconrad
Copy link
Contributor

This moves the knn check for adjusting search type to the top of the method instead of possibly "adjusting" the search type multiple times. Purely mechanical change for readability.

@jdconrad jdconrad requested a review from javanna May 24, 2023 19:53
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label May 24, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@@ -414,11 +420,6 @@ static void adjustSearchType(SearchRequest searchRequest, boolean singleShard) {
searchRequest.requestCache(false);
searchRequest.searchType(QUERY_THEN_FETCH);
}

Copy link
Member

Choose a reason for hiding this comment

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

should we also move up the isSuggestOnly branch and return from it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! That also makes sense. I will make the change.

@jdconrad
Copy link
Contributor Author

@javanna Thank you for the review!

@jdconrad jdconrad merged commit 8b83636 into elastic:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants