Skip to content

[Slice] Introduce initial _slice API changes - #147185

Merged
benwtrent merged 9 commits into
elastic:mainfrom
benwtrent:feature/introducing_index_slices
Apr 24, 2026
Merged

benwtrent merged 9 commits into
elastic:mainfrom
benwtrent:feature/introducing_index_slices

Conversation

@benwtrent

Copy link
Copy Markdown
Contributor

This is the first of likely many PRs.

Introduces:

  • Slice feature flag, behind which all slice logic will reside
  • The ability to use _slice on PUT/POST/BULK/UPDATE
  • Validations on slice input (fairly restrictive now, may make less restrictive later)
  • ensuring that routing & slicing are mutually exclusive
  • forcing slice to be provided on the touched APIs or not provided depending on the setting
  • testing various edge cases (templates, feature flag being off, etc.)

@benwtrent
benwtrent requested review from iverase and jimczi April 22, 2026 20:56
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Apr 22, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

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

@jimczi jimczi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! I left one comment regarding the new parameter on index request.
I also wonder how delete works? Do we need the same change to handle deletes with slice similarly to how update works?

private String id;
@Nullable
private String routing;
private boolean routingFromSlice;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This value is not written on serialization so currently it is lost when transport is used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jimczi yes, I am testing a bunch of edge cases to see if we actually need a transport layer change for this.

I am suspecting, yes, when I move to add delete and update. But didn't exactly see the need for it here.

@benwtrent

Copy link
Copy Markdown
Contributor Author

I also wonder how delete works? Do we need the same change to handle deletes with slice similarly to how update works?

Future PR!

And GET and UPDATE BY QUERY and REINDEX. This PR already got about 500 LOC more than I thought it was gonna be.

@benwtrent
benwtrent merged commit ebb7b7c into elastic:main Apr 24, 2026
37 checks passed
@benwtrent
benwtrent deleted the feature/introducing_index_slices branch April 24, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants