File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 5252import static org .elasticsearch .xpack .core .ClientHelper .ML_ORIGIN ;
5353import static org .elasticsearch .xpack .core .ClientHelper .executeAsyncWithOrigin ;
5454
55- // TODO: Only allow CCS when ccs_minimize_roundtrips=true
5655// TODO: Add flag to perform inference again during remote cluster coordinator rewrite
5756
5857public class SemanticQueryBuilder extends AbstractQueryBuilder <SemanticQueryBuilder > {
@@ -252,6 +251,10 @@ private SemanticQueryBuilder doRewriteGetInferenceResults(QueryRewriteContext qu
252251 throw new IllegalStateException (
253252 "Rewriting on the coordinator node requires a query rewrite context with non-null resolved indices"
254253 );
254+ } else if (resolvedIndices .getRemoteClusterIndices ().isEmpty () == false ) {
255+ if (queryRewriteContext .isCcsMinimizeRoundtrips () != true ) {
256+ throw new IllegalArgumentException (NAME + " query supports CCS only when ccs_minimize_roundtrips=true" );
257+ }
255258 }
256259
257260 Set <String > inferenceIds = getInferenceIdsForForField (resolvedIndices .getConcreteLocalIndicesMetadata ().values (), fieldName );
You can’t perform that action at this time.
0 commit comments