From 01f29a71b8faf458c251a47db4e334d6bbe55536 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Sun, 31 Dec 2023 05:21:09 +0600 Subject: [PATCH 1/8] Search pipelines added Signed-off-by: Tokesh --- .../create_search_pipeline/operations.smithy | 23 ++++++ .../create_search_pipeline/structures.smithy | 24 ++++++ .../get_search_pipeline/operations.smithy | 23 ++++++ .../get_search_pipeline/structures.smithy | 20 +++++ model/_global/search_pipeline.smithy | 80 +++++++++++++++++++ model/opensearch.smithy | 2 + 6 files changed, 172 insertions(+) create mode 100644 model/_global/create_search_pipeline/operations.smithy create mode 100644 model/_global/create_search_pipeline/structures.smithy create mode 100644 model/_global/get_search_pipeline/operations.smithy create mode 100644 model/_global/get_search_pipeline/structures.smithy create mode 100644 model/_global/search_pipeline.smithy diff --git a/model/_global/create_search_pipeline/operations.smithy b/model/_global/create_search_pipeline/operations.smithy new file mode 100644 index 000000000..33d7d04ad --- /dev/null +++ b/model/_global/create_search_pipeline/operations.smithy @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@externalDocumentation( + "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/creating-search-pipeline/" +) + +@xOperationGroup("create_search_pipeline") +@xVersionAdded("2.9") +@idempotent +@suppress(["HttpUriConflict"]) +@http(method: "PUT", uri: "/_search/pipeline/{pipeline}") +@documentation("Creates or replaces the specified search pipeline.") +operation CreateSearchPipeline { + input: CreateSearchPipeline_Input, + output: CreateSearchPipeline_Output +} diff --git a/model/_global/create_search_pipeline/structures.smithy b/model/_global/create_search_pipeline/structures.smithy new file mode 100644 index 000000000..3996cfebd --- /dev/null +++ b/model/_global/create_search_pipeline/structures.smithy @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + + +@input +structure CreateSearchPipeline_Input{ + @required + @httpLabel + pipeline: String + @required + @httpPayload + content: SearchPipeline +} + +@output +structure CreateSearchPipeline_Output { + acknowledged: Boolean +} diff --git a/model/_global/get_search_pipeline/operations.smithy b/model/_global/get_search_pipeline/operations.smithy new file mode 100644 index 000000000..14ea6b039 --- /dev/null +++ b/model/_global/get_search_pipeline/operations.smithy @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@externalDocumentation( + "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/index/" +) + +@xOperationGroup("get_search_pipeline") +@xVersionAdded("2.9") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_search/pipeline/{pipeline}") +@documentation("Retrieves information about a specified search pipeline.") +operation GetSearchPipeline { + input: GetSearchPipeline_Input, + output: GetSearchPipeline_Output +} diff --git a/model/_global/get_search_pipeline/structures.smithy b/model/_global/get_search_pipeline/structures.smithy new file mode 100644 index 000000000..ed69fcd87 --- /dev/null +++ b/model/_global/get_search_pipeline/structures.smithy @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@input +structure GetSearchPipeline_Input { + @required + @httpLabel + pipeline: String, +} + +structure GetSearchPipeline_Output { + @httpPayload + content: SearchPipeline +} diff --git a/model/_global/search_pipeline.smithy b/model/_global/search_pipeline.smithy new file mode 100644 index 000000000..377014048 --- /dev/null +++ b/model/_global/search_pipeline.smithy @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +structure SearchPipeline{ + version: Integer, + request_processors: RequestProcessorsList, + response_processors: ResponseProcessorsList +} + +list RequestProcessorsList { + member: RequestProcessors +} + +list ResponseProcessorsList { + member: RequestProcessors +} + + +structure RequestProcessors { + filter_query: FilterQuery, + neural_query_enricher: NeuralQueryEnricher, + script: SearchScript +} + +structure ResponseProcessors { + personalize_search_ranking: PersonalizeSearchRanking, + rename_field: RenameField, +} + +structure FilterQuery { + query: UserDefinedObjectStructure, + tag: String, + description: String, + ignore_failure: Boolean +} + +structure NeuralQueryEnricher { + default_model_id: String, + neural_field_default_id: NeuralFieldMap + tag: String, + description: String, +} + +structure SearchScript { + source: String, + lang: String, + tag: String, + description: String, + ignore_failure: Boolean +} + +structure PersonalizeSearchRanking { + campaign_arn: String, + recipe: String, + weight: Float, + item_id_field: String, + iam_role_arn: String, + tag: String, + description: String, + ignore_failure: Boolean +} + +structure RenameField { + field: String, + target_field: String, + tag: String, + description: String, + ignore_failure: Boolean +} + +map NeuralFieldMap { + key: String, + value: String +} diff --git a/model/opensearch.smithy b/model/opensearch.smithy index ccb6b3805..e6a1d9da2 100644 --- a/model/opensearch.smithy +++ b/model/opensearch.smithy @@ -101,6 +101,7 @@ service OpenSearch { CreateUser, Create_Post, Create_Put, + CreateSearchPipeline, DanglingIndicesDeleteDanglingIndex, DanglingIndicesImportDanglingIndex, DanglingIndicesListDanglingIndices, @@ -143,6 +144,7 @@ service OpenSearch { GetRoles, GetRoleMapping, GetRoleMappings, + GetSearchPipeline, GetTenant, GetTenants, GetUser, From 65a5585a1bd2bd81af460bcd30973dea9fde7d48 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 3 Jan 2024 23:36:14 +0600 Subject: [PATCH 2/8] search_pipeline folder added Signed-off-by: Tokesh --- .../create_search_pipeline/operations.smithy | 0 .../create_search_pipeline/structures.smithy | 0 .../get_search_pipeline/operations.smithy | 2 +- .../get_search_pipeline/structures.smithy | 0 model/{_global => search_pipeline}/search_pipeline.smithy | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename model/{_global => search_pipeline}/create_search_pipeline/operations.smithy (100%) rename model/{_global => search_pipeline}/create_search_pipeline/structures.smithy (100%) rename model/{_global => search_pipeline}/get_search_pipeline/operations.smithy (92%) rename model/{_global => search_pipeline}/get_search_pipeline/structures.smithy (100%) rename model/{_global => search_pipeline}/search_pipeline.smithy (100%) diff --git a/model/_global/create_search_pipeline/operations.smithy b/model/search_pipeline/create_search_pipeline/operations.smithy similarity index 100% rename from model/_global/create_search_pipeline/operations.smithy rename to model/search_pipeline/create_search_pipeline/operations.smithy diff --git a/model/_global/create_search_pipeline/structures.smithy b/model/search_pipeline/create_search_pipeline/structures.smithy similarity index 100% rename from model/_global/create_search_pipeline/structures.smithy rename to model/search_pipeline/create_search_pipeline/structures.smithy diff --git a/model/_global/get_search_pipeline/operations.smithy b/model/search_pipeline/get_search_pipeline/operations.smithy similarity index 92% rename from model/_global/get_search_pipeline/operations.smithy rename to model/search_pipeline/get_search_pipeline/operations.smithy index 14ea6b039..52d60fd14 100644 --- a/model/_global/get_search_pipeline/operations.smithy +++ b/model/search_pipeline/get_search_pipeline/operations.smithy @@ -11,7 +11,7 @@ namespace OpenSearch "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/index/" ) -@xOperationGroup("get_search_pipeline") +@xOperationGroup("search_pipeline.get_search_pipeline") @xVersionAdded("2.9") @readonly @suppress(["HttpUriConflict"]) diff --git a/model/_global/get_search_pipeline/structures.smithy b/model/search_pipeline/get_search_pipeline/structures.smithy similarity index 100% rename from model/_global/get_search_pipeline/structures.smithy rename to model/search_pipeline/get_search_pipeline/structures.smithy diff --git a/model/_global/search_pipeline.smithy b/model/search_pipeline/search_pipeline.smithy similarity index 100% rename from model/_global/search_pipeline.smithy rename to model/search_pipeline/search_pipeline.smithy From 68d5a1e3be8826517ce28d321162899e97911c01 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Sun, 7 Jan 2024 19:25:16 +0600 Subject: [PATCH 3/8] small fix of operation group in create method Signed-off-by: Tokesh --- model/search_pipeline/create_search_pipeline/operations.smithy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/search_pipeline/create_search_pipeline/operations.smithy b/model/search_pipeline/create_search_pipeline/operations.smithy index 33d7d04ad..d65d13c36 100644 --- a/model/search_pipeline/create_search_pipeline/operations.smithy +++ b/model/search_pipeline/create_search_pipeline/operations.smithy @@ -11,7 +11,7 @@ namespace OpenSearch "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/creating-search-pipeline/" ) -@xOperationGroup("create_search_pipeline") +@xOperationGroup("search_pipeline.create_search_pipeline") @xVersionAdded("2.9") @idempotent @suppress(["HttpUriConflict"]) From 6ad4aaa51fc21dcdb794597afc4ead77d445e880 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Tue, 9 Jan 2024 10:18:34 +0600 Subject: [PATCH 4/8] rename search pipeline folders Signed-off-by: Tokesh --- .../{create_search_pipeline => create}/operations.smithy | 2 +- .../{create_search_pipeline => create}/structures.smithy | 0 .../{get_search_pipeline => get}/operations.smithy | 2 +- .../{get_search_pipeline => get}/structures.smithy | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename model/search_pipeline/{create_search_pipeline => create}/operations.smithy (92%) rename model/search_pipeline/{create_search_pipeline => create}/structures.smithy (100%) rename model/search_pipeline/{get_search_pipeline => get}/operations.smithy (92%) rename model/search_pipeline/{get_search_pipeline => get}/structures.smithy (100%) diff --git a/model/search_pipeline/create_search_pipeline/operations.smithy b/model/search_pipeline/create/operations.smithy similarity index 92% rename from model/search_pipeline/create_search_pipeline/operations.smithy rename to model/search_pipeline/create/operations.smithy index d65d13c36..13d7c5762 100644 --- a/model/search_pipeline/create_search_pipeline/operations.smithy +++ b/model/search_pipeline/create/operations.smithy @@ -11,7 +11,7 @@ namespace OpenSearch "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/creating-search-pipeline/" ) -@xOperationGroup("search_pipeline.create_search_pipeline") +@xOperationGroup("search_pipeline.create") @xVersionAdded("2.9") @idempotent @suppress(["HttpUriConflict"]) diff --git a/model/search_pipeline/create_search_pipeline/structures.smithy b/model/search_pipeline/create/structures.smithy similarity index 100% rename from model/search_pipeline/create_search_pipeline/structures.smithy rename to model/search_pipeline/create/structures.smithy diff --git a/model/search_pipeline/get_search_pipeline/operations.smithy b/model/search_pipeline/get/operations.smithy similarity index 92% rename from model/search_pipeline/get_search_pipeline/operations.smithy rename to model/search_pipeline/get/operations.smithy index 52d60fd14..59ae56eaa 100644 --- a/model/search_pipeline/get_search_pipeline/operations.smithy +++ b/model/search_pipeline/get/operations.smithy @@ -11,7 +11,7 @@ namespace OpenSearch "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/index/" ) -@xOperationGroup("search_pipeline.get_search_pipeline") +@xOperationGroup("search_pipeline.get") @xVersionAdded("2.9") @readonly @suppress(["HttpUriConflict"]) diff --git a/model/search_pipeline/get_search_pipeline/structures.smithy b/model/search_pipeline/get/structures.smithy similarity index 100% rename from model/search_pipeline/get_search_pipeline/structures.smithy rename to model/search_pipeline/get/structures.smithy From ceaaaad471da74ed937df53b8728ccc404f68153 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Tue, 9 Jan 2024 10:22:49 +0600 Subject: [PATCH 5/8] renaming search pipeline to resolve conflict with main branch Signed-off-by: Tokesh --- model/search_pipeline/create/structures.smithy | 2 +- model/search_pipeline/get/structures.smithy | 2 +- model/search_pipeline/search_pipeline.smithy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/model/search_pipeline/create/structures.smithy b/model/search_pipeline/create/structures.smithy index 3996cfebd..69c89c77d 100644 --- a/model/search_pipeline/create/structures.smithy +++ b/model/search_pipeline/create/structures.smithy @@ -15,7 +15,7 @@ structure CreateSearchPipeline_Input{ pipeline: String @required @httpPayload - content: SearchPipeline + content: SearchPipelineStructure } @output diff --git a/model/search_pipeline/get/structures.smithy b/model/search_pipeline/get/structures.smithy index ed69fcd87..4ca0ab11b 100644 --- a/model/search_pipeline/get/structures.smithy +++ b/model/search_pipeline/get/structures.smithy @@ -16,5 +16,5 @@ structure GetSearchPipeline_Input { structure GetSearchPipeline_Output { @httpPayload - content: SearchPipeline + content: SearchPipelineStructure } diff --git a/model/search_pipeline/search_pipeline.smithy b/model/search_pipeline/search_pipeline.smithy index 377014048..9d1ccdf91 100644 --- a/model/search_pipeline/search_pipeline.smithy +++ b/model/search_pipeline/search_pipeline.smithy @@ -7,7 +7,7 @@ $version: "2" namespace OpenSearch -structure SearchPipeline{ +structure SearchPipelineStructure{ version: Integer, request_processors: RequestProcessorsList, response_processors: ResponseProcessorsList From d5c296126912dddef7b5f1875d20414f2f90ccba Mon Sep 17 00:00:00 2001 From: Tokesh Date: Wed, 7 Feb 2024 21:56:00 +0600 Subject: [PATCH 6/8] adding map for main structure, main search pipeline API spces, phase result processor Signed-off-by: Tokesh --- model/search_pipeline/get/operations.smithy | 11 +++++++ model/search_pipeline/get/structures.smithy | 13 +++++++- model/search_pipeline/search_pipeline.smithy | 32 +++++++++++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/model/search_pipeline/get/operations.smithy b/model/search_pipeline/get/operations.smithy index 59ae56eaa..5029c140a 100644 --- a/model/search_pipeline/get/operations.smithy +++ b/model/search_pipeline/get/operations.smithy @@ -11,6 +11,17 @@ namespace OpenSearch "API Reference": "https://opensearch.org/docs/latest/search-plugins/search-pipelines/index/" ) +@xOperationGroup("search_pipeline.get") +@xVersionAdded("2.9") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_search/pipeline") +@documentation("Retrieves information about search pipelines.") +operation GetSearchPipelines { + input: GetSearchPipelines_Input, + output: GetSearchPipelines_Output +} + @xOperationGroup("search_pipeline.get") @xVersionAdded("2.9") @readonly diff --git a/model/search_pipeline/get/structures.smithy b/model/search_pipeline/get/structures.smithy index 4ca0ab11b..ab90164c7 100644 --- a/model/search_pipeline/get/structures.smithy +++ b/model/search_pipeline/get/structures.smithy @@ -7,6 +7,16 @@ $version: "2" namespace OpenSearch +@input +structure GetSearchPipelines_Input { +} + +@output +structure GetSearchPipelines_Output { + @httpPayload + content: SearchPipelineMap +} + @input structure GetSearchPipeline_Input { @required @@ -14,7 +24,8 @@ structure GetSearchPipeline_Input { pipeline: String, } +@output structure GetSearchPipeline_Output { @httpPayload - content: SearchPipelineStructure + content: SearchPipelineMap } diff --git a/model/search_pipeline/search_pipeline.smithy b/model/search_pipeline/search_pipeline.smithy index 9d1ccdf91..6ae20ed62 100644 --- a/model/search_pipeline/search_pipeline.smithy +++ b/model/search_pipeline/search_pipeline.smithy @@ -7,10 +7,16 @@ $version: "2" namespace OpenSearch +map SearchPipelineMap{ + key: String, + value: SearchPipelineStructure +} + structure SearchPipelineStructure{ version: Integer, request_processors: RequestProcessorsList, - response_processors: ResponseProcessorsList + response_processors: ResponseProcessorsList, + phase_results_processors: PhaseResultsProcessorsList } list RequestProcessorsList { @@ -21,6 +27,9 @@ list ResponseProcessorsList { member: RequestProcessors } +list PhaseResultsProcessorsList { + member: PhaseResultsProcessors +} structure RequestProcessors { filter_query: FilterQuery, @@ -33,6 +42,27 @@ structure ResponseProcessors { rename_field: RenameField, } +structure PhaseResultsProcessors { + normalization: ScoreNormalization, + combination: ScoreCombination, + tag: String, + description: String, + ignore_failure: Boolean +} + +structure ScoreNormalization{ + technique: String +} + +structure ScoreCombination{ + technique: String, + parameters: ScoreWeights +} + +list ScoreWeights{ + member: Float +} + structure FilterQuery { query: UserDefinedObjectStructure, tag: String, From 6faa5096074c6d5c37e9d68fbc298ca50722e087 Mon Sep 17 00:00:00 2001 From: Niyazbek Torekeldi <78027392+Tokesh@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:31:37 +0600 Subject: [PATCH 7/8] Update model/search_pipeline/search_pipeline.smithy Co-authored-by: Thomas Farr Signed-off-by: Niyazbek Torekeldi <78027392+Tokesh@users.noreply.github.com> --- model/search_pipeline/search_pipeline.smithy | 228 +++++++++++++------ 1 file changed, 161 insertions(+), 67 deletions(-) diff --git a/model/search_pipeline/search_pipeline.smithy b/model/search_pipeline/search_pipeline.smithy index 6ae20ed62..2518bc651 100644 --- a/model/search_pipeline/search_pipeline.smithy +++ b/model/search_pipeline/search_pipeline.smithy @@ -7,104 +7,198 @@ $version: "2" namespace OpenSearch -map SearchPipelineMap{ - key: String, +map SearchPipelineMap { + key: String value: SearchPipelineStructure } -structure SearchPipelineStructure{ - version: Integer, - request_processors: RequestProcessorsList, - response_processors: ResponseProcessorsList, - phase_results_processors: PhaseResultsProcessorsList +structure SearchPipelineStructure { + version: Integer + request_processors: RequestProcessorList + response_processors: ResponseProcessorList + phase_results_processors: PhaseResultsProcessorList } -list RequestProcessorsList { - member: RequestProcessors +// === Common Properties === + +@mixin +structure ProcessorBase { + tag: String + description: String } -list ResponseProcessorsList { - member: RequestProcessors +@mixin +structure IgnoreableProcessorBase with [ProcessorBase] { + ignore_failure: Boolean } -list PhaseResultsProcessorsList { - member: PhaseResultsProcessors +// === Request Processors === + +list RequestProcessorList { + member: RequestProcessor } -structure RequestProcessors { - filter_query: FilterQuery, - neural_query_enricher: NeuralQueryEnricher, - script: SearchScript +union RequestProcessor { + filter_query: FilterQueryRequestProcessor + neural_query_enricher: NeuralQueryEnricherRequestProcessor + script: SearchScriptRequestProcessor + oversample: OversampleRequestProcessor } -structure ResponseProcessors { - personalize_search_ranking: PersonalizeSearchRanking, - rename_field: RenameField, +structure FilterQueryRequestProcessor with [IgnoreableProcessorBase] { + query: UserDefinedObjectStructure } -structure PhaseResultsProcessors { - normalization: ScoreNormalization, - combination: ScoreCombination, - tag: String, - description: String, - ignore_failure: Boolean +structure NeuralQueryEnricherRequestProcessor with [ProcessorBase] { + default_model_id: String + neural_field_default_id: NeuralFieldMap } -structure ScoreNormalization{ - technique: String +map NeuralFieldMap { + key: String + value: String } -structure ScoreCombination{ - technique: String, - parameters: ScoreWeights +structure SearchScriptRequestProcessor with [IgnoreableProcessorBase] { + @required + source: String + + lang: String } -list ScoreWeights{ - member: Float +structure OversampleRequestProcessor with [IgnoreableProcessorBase] { + @required + sample_factor: Float + + content_prefix: String } -structure FilterQuery { - query: UserDefinedObjectStructure, - tag: String, - description: String, - ignore_failure: Boolean +// === Response Processors === + +list ResponseProcessorList { + member: RequestProcessor } -structure NeuralQueryEnricher { - default_model_id: String, - neural_field_default_id: NeuralFieldMap - tag: String, - description: String, +union ResponseProcessor { + personalize_search_ranking: PersonalizeSearchRankingResponseProcessor + retrieval_augmented_generation: RetrievalAugmentedGenerationResponseProcessor + rename_field: RenameFieldResponseProcessor + rerank: RerankResponseProcessor + collapse: CollapseResponseProcessor + truncate_hits: TruncateHitsResponseProcessor } -structure SearchScript { - source: String, - lang: String, - tag: String, - description: String, - ignore_failure: Boolean +structure PersonalizeSearchRankingResponseProcessor with [IgnoreableProcessorBase] { + @required + campaign_arn: String + + @required + recipe: String + + @required + weight: Float + + item_id_field: String + + iam_role_arn: String } -structure PersonalizeSearchRanking { - campaign_arn: String, - recipe: String, - weight: Float, - item_id_field: String, - iam_role_arn: String, - tag: String, - description: String, - ignore_failure: Boolean +structure RetrievalAugmentedGenerationResponseProcessor with [ProcessorBase] { + @required + model_id: String + + @required + context_field_list: ContextFieldList + + system_prompt: String + + user_instructions: String } -structure RenameField { - field: String, - target_field: String, - tag: String, - description: String, - ignore_failure: Boolean +list ContextFieldList { + member: String } -map NeuralFieldMap { - key: String, - value: String +structure RenameFieldResponseProcessor with [IgnoreableProcessorBase] { + @required + field: String + + @required + target_field: String +} + +structure RerankResponseProcessor with [IgnoreableProcessorBase] { + ml_opensearch: MLOpenSearchReranker + context: RerankContext +} + +structure MLOpenSearchReranker { + @required + model_id: String +} + +structure RerankContext { + @required + document_fields: DocumentFieldList +} + +list DocumentFieldList { + member: String +} + +structure CollapseResponseProcessor with [IgnoreableProcessorBase] { + @required + field: String + + context_prefix: String +} + +structure TruncateHitsResponseProcessor with [IgnoreableProcessorBase] { + target_size: Integer + context_prefix: String +} + +// === Phase Results Processors === + +list PhaseResultsProcessorList { + member: PhaseResultsProcessor +} + +union PhaseResultsProcessor { + @jsonName("normalization-processor") + normalization_processor: NormalizationPhaseResultsProcessor +} + +structure NormalizationPhaseResultsProcessor with [IgnoreableProcessorBase] { + normalization: ScoreNormalization + combination: ScoreCombination } + +structure ScoreNormalization { + technique: ScoreNormalizationTechnique +} + +enum ScoreNormalizationTechnique { + MIN_MAX = "min_max" + L2 = "l2" +} + +structure ScoreCombination { + technique: ScoreCombinationTechnique + parameters: ScoreWeights +} + +enum ScoreCombinationTechnique { + ARITHMETIC_MEAN = "arithmetic_mean" + GEOMETRIC_MEAN = "geometric_mean" + HARMONIC_MEAN = "harmonic_mean" +} + +structure ScoreCombinationParameters { + weights: ScoreWeights +} + +list ScoreWeights { + member: Float +} + From 1a901cdfd2db877de93529c386fe4c9c924ac7f7 Mon Sep 17 00:00:00 2001 From: Niyazbek Torekeldi <78027392+Tokesh@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:45:54 +0500 Subject: [PATCH 8/8] spotless Apply Signed-off-by: Niyazbek Torekeldi <78027392+Tokesh@users.noreply.github.com> --- model/search_pipeline/search_pipeline.smithy | 1 - 1 file changed, 1 deletion(-) diff --git a/model/search_pipeline/search_pipeline.smithy b/model/search_pipeline/search_pipeline.smithy index 2518bc651..7cfa4568e 100644 --- a/model/search_pipeline/search_pipeline.smithy +++ b/model/search_pipeline/search_pipeline.smithy @@ -201,4 +201,3 @@ structure ScoreCombinationParameters { list ScoreWeights { member: Float } -