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

[Feature Request] Enabling phase_took_enabled as a Search request parameter #14023

Closed
navneet1v opened this issue Jun 6, 2024 · 2 comments
Closed
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc untriaged

Comments

@navneet1v
Copy link
Contributor

navneet1v commented Jun 6, 2024

Is your feature request related to a problem? Please describe

I came across this setting phase_took_enabled which I liked very much, but this is a cluster level setting and once it is added the setting is enabled for all searches, which is not my usecase. My usecase is I want to get this breakdown of phase level took time for few of my expensive queries hence I want to control this setting via URL parameter of search api.

Similar thing is available for default_allow_partial_results where either I can set this as a setting or pass this as a URL parameter in search.

Ref docs: https://opensearch.org/docs/latest/install-and-configure/configuring-opensearch/search-settings/

Describe the solution you'd like

Make the setting phase_took_enabled also a URL parameter for Search api.

Related component

Search

Describe alternatives you've considered

NA

Additional context

Ref docs: https://opensearch.org/docs/latest/install-and-configure/configuring-opensearch/search-settings/

@navneet1v navneet1v added enhancement Enhancement or improvement to existing feature or request untriaged labels Jun 6, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Jun 6, 2024
@msfroh
Copy link
Collaborator

msfroh commented Jun 9, 2024

Good news! It is available as a search request parameter.

You just need to set &phase_took=true in your URL:

if (request.hasParam("phase_took")) {
// only set if we have the parameter passed to override the cluster-level default
// else phaseTook = null
searchRequest.setPhaseTook(request.paramAsBoolean("phase_took", true));
}

It looks like we did remember to include it in the list of URL parameters in the search API documentation: https://opensearch.org/docs/latest/api-reference/search/#url-parameters

@navneet1v
Copy link
Contributor Author

Thanks this was helpful. Closing this GH issue.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Search Project Board Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc untriaged
Projects
Archived in project
Development

No branches or pull requests

2 participants