From 09d94d4a2c7b1987392a6c8c84121ac0399aa9b6 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 20 Mar 2024 16:26:08 -0700 Subject: [PATCH] Added rest_total_hits_as_int param in Search API and primary_only in Forcemerge API Signed-off-by: saimedhi --- model/_global/search/structures.smithy | 6 +++++- model/common_booleans.smithy | 6 ++++++ model/indices/forcemerge/structures.smithy | 4 ++++ model/knn/stats/operations.smithy | 4 ++-- model/knn/stats/structures.smithy | 4 ++-- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/model/_global/search/structures.smithy b/model/_global/search/structures.smithy index 97a47e82a..83faf71b3 100644 --- a/model/_global/search/structures.smithy +++ b/model/_global/search/structures.smithy @@ -151,7 +151,11 @@ structure Search_QueryParams { rest_total_hits_as_int: RestTotalHitsAsInt, @httpQuery("search_pipeline") - search_pipeline: SearchPipeline + search_pipeline: SearchPipeline, + + @httpQuery("include_named_queries_score") + @default(false) + include_named_queries_score: RestTotalHitsAsInt } @documentation("The search definition using the Query DSL") diff --git a/model/common_booleans.smithy b/model/common_booleans.smithy index e3dc25fde..8221b08c1 100644 --- a/model/common_booleans.smithy +++ b/model/common_booleans.smithy @@ -89,6 +89,9 @@ boolean IncludeDefaults @documentation("Return information about disk usage and shard sizes.") boolean IncludeDiskInfo +@documentation("Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false)") +boolean IncludeNamedQueriesScore + @documentation("Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).") boolean IncludeSegmentFileSizes @@ -131,6 +134,9 @@ boolean PreserveExisting @documentation("Set to true to return stats only for primary shards.") boolean Pri +@documentation("Specify whether the operation should only perform on primary shards. Defaults to false.") +boolean PrimaryOnly + @documentation("Specify whether to profile the query execution.") boolean Profile diff --git a/model/indices/forcemerge/structures.smithy b/model/indices/forcemerge/structures.smithy index 655da3d9e..81b47f468 100644 --- a/model/indices/forcemerge/structures.smithy +++ b/model/indices/forcemerge/structures.smithy @@ -13,6 +13,10 @@ structure IndicesForcemerge_QueryParams { @default(true) flush: Flush, + @httpQuery("primary_only") + @default(false) + primary_only: PrimaryOnly, + @httpQuery("ignore_unavailable") ignore_unavailable: IgnoreUnavailable, diff --git a/model/knn/stats/operations.smithy b/model/knn/stats/operations.smithy index 6186c9410..dd4a3b985 100644 --- a/model/knn/stats/operations.smithy +++ b/model/knn/stats/operations.smithy @@ -26,7 +26,7 @@ operation KNNStats { @xVersionAdded("1.0") @readonly @suppress(["HttpUriConflict"]) -@http(method: "GET", uri: "/_plugins/_knn/{nodeId}/stats") +@http(method: "GET", uri: "/_plugins/_knn/{node_id}/stats") @documentation("Provides information about the current status of the k-NN plugin.") operation KNNStats_WithNodeId { input: KNNStats_WithNodeId_Input, @@ -48,7 +48,7 @@ operation KNNStats_WithStat { @xVersionAdded("1.0") @readonly @suppress(["HttpUriConflict"]) -@http(method: "GET", uri: "/_plugins/_knn/{nodeId}/stats/{stat}") +@http(method: "GET", uri: "/_plugins/_knn/{node_id}/stats/{stat}") @documentation("Provides information about the current status of the k-NN plugin.") operation KNNStats_WithStatNodeId { input: KNNStats_WithStatNodeId_Input, diff --git a/model/knn/stats/structures.smithy b/model/knn/stats/structures.smithy index c48fb14fb..340e9f10c 100644 --- a/model/knn/stats/structures.smithy +++ b/model/knn/stats/structures.smithy @@ -21,7 +21,7 @@ structure KNNStats_Input with [KNNStats_QueryParams] { structure KNNStats_WithNodeId_Input with [KNNStats_QueryParams] { @required @httpLabel - nodeId: PathNodeId, + node_id: PathNodeId, } @input @@ -35,7 +35,7 @@ structure KNNStats_WithStat_Input with [KNNStats_QueryParams] { structure KNNStats_WithStatNodeId_Input with [KNNStats_QueryParams] { @required @httpLabel - nodeId: PathNodeId, + node_id: PathNodeId, @required @httpLabel