Skip to content

Commit 718dde1

Browse files
maxhniebergallelasticmachine
authored andcommitted
only return deprecation warning for elser service (elastic#114507)
Co-authored-by: Elastic Machine <[email protected]>
1 parent 2ca9d7a commit 718dde1

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public void parseRequestConfig(
151151
config,
152152
arch,
153153
serviceSettingsMap,
154+
true,
154155
chunkingSettings,
155156
modelListener
156157
)
@@ -182,6 +183,7 @@ public void parseRequestConfig(
182183
config,
183184
arch,
184185
serviceSettingsMap,
186+
OLD_ELSER_SERVICE_NAME.equals(serviceName),
185187
chunkingSettings,
186188
modelListener
187189
)
@@ -341,6 +343,7 @@ private void elserCase(
341343
Map<String, Object> config,
342344
Set<String> platformArchitectures,
343345
Map<String, Object> serviceSettingsMap,
346+
boolean isElserService,
344347
ChunkingSettings chunkingSettings,
345348
ActionListener<Model> modelListener
346349
) {
@@ -371,15 +374,17 @@ private void elserCase(
371374
}
372375
}
373376

374-
DEPRECATION_LOGGER.warn(
375-
DeprecationCategory.API,
376-
"inference_api_elser_service",
377-
"The [{}] service is deprecated and will be removed in a future release. Use the [{}] service instead, with"
378-
+ " [model_id] set to [{}] in the [service_settings]",
379-
OLD_ELSER_SERVICE_NAME,
380-
ElasticsearchInternalService.NAME,
381-
defaultModelId
382-
);
377+
if (isElserService) {
378+
DEPRECATION_LOGGER.warn(
379+
DeprecationCategory.API,
380+
"inference_api_elser_service",
381+
"The [{}] service is deprecated and will be removed in a future release. Use the [{}] service instead, with"
382+
+ " [model_id] set to [{}] in the [service_settings]",
383+
OLD_ELSER_SERVICE_NAME,
384+
ElasticsearchInternalService.NAME,
385+
defaultModelId
386+
);
387+
}
383388

384389
if (modelVariantDoesNotMatchArchitecturesAndIsNotPlatformAgnostic(platformArchitectures, esServiceSettingsBuilder.getModelId())) {
385390
throw new IllegalArgumentException(

0 commit comments

Comments
 (0)