Skip to content

Include original target and query in profiled search results - #145230

Merged
chrisparrinello merged 65 commits into
elastic:mainfrom
chrisparrinello:profile-report-target-query
Apr 29, 2026
Merged

chrisparrinello merged 65 commits into
elastic:mainfrom
chrisparrinello:profile-report-target-query

Conversation

@chrisparrinello

@chrisparrinello chrisparrinello commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #143783

This PR adds a request object to the profile object in the search response when profile: true is in the original search request. The request object contains two attributes:

  • source -- This contains the original query source from the search query request.
  • indices -- This contains the target indices from the request.

An example response: https://gist.github.com/chrisparrinello/b675ae4eaf941fc391c46ab8abfcf639

The original source is copied via a shallow copy which might not have full fidelity with the original request.

@chrisparrinello
chrisparrinello marked this pull request as ready for review April 1, 2026 17:27
@chrisparrinello
chrisparrinello requested review from a team as code owners April 1, 2026 17:27
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Apr 1, 2026
@chrisparrinello chrisparrinello added >enhancement Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations and removed needs:triage Requires assignment of a team area label labels Apr 1, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @chrisparrinello, I've created a changelog YAML for you.

Comment thread server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java Outdated
Comment thread docs/changelog/145230.yaml Outdated
@chrisparrinello
chrisparrinello requested review from a team as code owners April 28, 2026 15:50
@chrisparrinello
chrisparrinello force-pushed the profile-report-target-query branch from 26bc56c to 4d2db47 Compare April 28, 2026 15:53
@chrisparrinello
chrisparrinello enabled auto-merge (squash) April 29, 2026 14:42
@chrisparrinello
chrisparrinello merged commit 1a46f5c into elastic:main Apr 29, 2026
39 checks passed
@chrisparrinello
chrisparrinello deleted the profile-report-target-query branch April 29, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search Profile API | Report target+query

5 participants