-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Refactor CrossProjectIndexExpressionsRewriter
#135588
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
elasticsearchmachine
merged 21 commits into
elastic:main
from
n1v0lg:cps-expression-rewriter
Sep 30, 2025
Merged
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a6df704
Move ProjectRoutingInfo to es
n1v0lg 742312a
Move rewriter
n1v0lg 512683e
Register exception
n1v0lg 39c88aa
Fix test
n1v0lg 888dd34
Refactor CrossProjectIndexExpressionsRewriter
n1v0lg 4ee8574
Merge branch 'main' into cps-expression-rewriter
n1v0lg 4c68a58
Tweaks
n1v0lg 1d0f236
Tweaks
n1v0lg 2fed52f
Undo rename for smaller diff
n1v0lg 40ac698
Few more tweaks
n1v0lg 6a41269
Merge branch 'main' into cps-expression-rewriter
n1v0lg 0576fc5
Merge branch 'main' into cps-expression-rewriter
n1v0lg b57fdaf
Merge branch 'main' into cps-expression-rewriter
n1v0lg bccd38a
Merge branch 'main' into cps-expression-rewriter
n1v0lg 8776392
Merge branch 'main' into cps-expression-rewriter
n1v0lg de16ced
Renames
n1v0lg b590601
Nits
n1v0lg d3f721c
Merge branch 'main' into cps-expression-rewriter
n1v0lg bb26fac
Merge branch 'main' into cps-expression-rewriter
n1v0lg 5156949
Merge branch 'main' into cps-expression-rewriter
n1v0lg 31ea856
Merge branch 'main' into cps-expression-rewriter
n1v0lg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
server/src/main/java/org/elasticsearch/search/crossproject/LocalWithRemoteExpressions.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| package org.elasticsearch.search.crossproject; | ||
|
|
||
| import org.elasticsearch.core.Nullable; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * A container for a local expression and a list of remote expressions. | ||
| */ | ||
| public record LocalWithRemoteExpressions(@Nullable String localExpression, List<String> remoteExpressions) { | ||
| public LocalWithRemoteExpressions(String localExpression) { | ||
| this(localExpression, List.of()); | ||
| } | ||
|
|
||
| List<String> all() { | ||
| if (localExpression == null) { | ||
| return remoteExpressions; | ||
| } | ||
| List<String> all = new ArrayList<>(); | ||
| all.add(localExpression); | ||
| all.addAll(remoteExpressions); | ||
| return List.copyOf(all); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will disappear once we've removed
public static Map<String, List<String>> rewriteIndexExpressionsin favor of callingrewriteIndexExpressioninside the IndexAbstractionResolver