Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 33 additions & 65 deletions protos/generated/models/aggregated_models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ message DateDecayPlacement {
optional string origin = 3;

// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value.
optional string scale = 4;
string scale = 4;
}
message DateHistogramAggregate {
// The custom metadata attached to a resource.
Expand Down Expand Up @@ -1459,7 +1459,13 @@ message DateRangeQuery {
// The time zone identifier.
optional string time_zone = 11;

string field = 12;
// Include the lower bound
optional bool include_lower = 12;

// Include the upper bound
optional bool include_upper = 13;

string field = 14;
}
message DateRangeQueryAllOfFrom {
oneof date_range_query_all_of_from {
Expand Down Expand Up @@ -1497,11 +1503,13 @@ message DecayFunctionBase {
optional MultiValueMode multi_value_mode = 1;
}
message DecayPlacement {
optional DateDecayPlacement date_decay_placement = 1;
oneof decay_placement {
DateDecayPlacement date_decay_placement = 1;

optional GeoDecayPlacement geo_decay_placement = 2;
GeoDecayPlacement geo_decay_placement = 2;

optional NumericDecayPlacement numeric_decay_placement = 3;
NumericDecayPlacement numeric_decay_placement = 3;
}
}
message DeleteOperation {
// The routing value for the document.
Expand Down Expand Up @@ -2489,9 +2497,9 @@ message GeoDecayPlacement {

optional string offset = 2;

optional GeoLocation origin = 3;
GeoLocation origin = 3;

optional string scale = 4;
string scale = 4;
}
message GeoDistanceAggregate {
// The custom metadata attached to a resource.
Expand Down Expand Up @@ -2538,7 +2546,10 @@ message GeoDistanceQuery {
// Set to `true` to ignore an unmapped field and not match any documents for this query. Set to `false` to throw an exception if the field is not mapped.
optional bool ignore_unmapped = 6;

map<string, GeoLocation> location = 7;
// The unit of distance measurement.
optional DistanceUnit unit = 7;

map<string, GeoLocation> location = 8;
}
message GeoDistanceSort {
// The mode for sorting on array or multi-valued fields.
Expand Down Expand Up @@ -4787,7 +4798,13 @@ message NumberRangeQuery {

optional NumberRangeQueryAllOfTo to = 9;

string field = 10;
// Include the lower bound
optional bool include_lower = 10;

// Include the upper bound
optional bool include_upper = 11;

string field = 12;
}
message NumberRangeQueryAllOfFrom {
oneof number_range_query_all_of_from {
Expand All @@ -4812,9 +4829,9 @@ message NumericDecayPlacement {

optional double offset = 2;

optional double origin = 3;
double origin = 3;

optional double scale = 4;
double scale = 4;
}
enum OpType {
OP_TYPE_UNSPECIFIED = 0;
Expand Down Expand Up @@ -5475,7 +5492,9 @@ message RandomScoreFunctionSeed {
oneof random_score_function_seed {
int32 int32 = 1;

string string = 2;
int64 int64 = 2;

string string = 3;
}
}
message RangeAggregate {
Expand Down Expand Up @@ -5990,7 +6009,7 @@ message SearchResponse {

optional PhaseTook phase_took = 3;

SearchResultHits hits = 4;
HitsMetadata hits = 4;

repeated ProcessorExecutionDetail processor_results = 5;

Expand Down Expand Up @@ -6022,7 +6041,7 @@ message SearchResult {

optional PhaseTook phase_took = 3;

SearchResultHits hits = 4;
HitsMetadata hits = 4;

repeated ProcessorExecutionDetail processor_results = 5;

Expand All @@ -6047,57 +6066,6 @@ message SearchResult {

optional string x_scroll_id = 15;
}
message SearchResultHits {
optional HitsMetadataTotal total = 1;

repeated SearchResultHitsAllOfHitsInner hits = 2;

optional HitsMetadataMaxScore max_score = 3;
}
message SearchResultHitsAllOfHitsInner {
optional ObjectMap fields = 1;

map<string, StringArray> highlight = 2;

map<string, InnerHitsResult> inner_hits = 3;

repeated string matched_queries = 4;

map<string, StringArray> ignored_field_values = 5;

repeated FieldValue sort = 6;

// The type of document or resource.
optional string x_type = 7;

optional string x_index = 8;

// The unique identifier for a resource.
optional string x_id = 9;

optional HitXScore x_score = 10;

optional Explanation x_explanation = 11;

optional NestedIdentity x_nested = 12;

repeated string x_ignored = 13;

optional string x_shard = 14;

optional string x_node = 15;

optional string x_routing = 16;

optional ObjectMap x_source = 17;

// The sequence number of the document.
optional int64 x_seq_no = 18;

optional int64 x_primary_term = 19;

optional int64 x_version = 20;
}
enum SearchType {
SEARCH_TYPE_UNSPECIFIED = 0;
SEARCH_TYPE_DFS_QUERY_THEN_FETCH = 1;
Expand Down
110 changes: 31 additions & 79 deletions protos/generated/services/default_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,145 +87,97 @@ message SearchRequest {
// If `true`, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.
optional bool analyze_wildcard = 7;

// Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.
optional string analyzer = 8;

// The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
optional int32 batched_reduce_size = 9;
optional int32 batched_reduce_size = 8;

// The time after which the search request will be canceled. Request-level parameter takes precedence over `cancel_after_time_interval` cluster setting.
optional string cancel_after_time_interval = 10;
optional string cancel_after_time_interval = 9;

// If `true`, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.
optional bool ccs_minimize_roundtrips = 11;
optional bool ccs_minimize_roundtrips = 10;

// The default operator for query string query: AND or OR. This parameter can only be used when the `q` query string parameter is specified.
optional Operator default_operator = 12;
optional Operator default_operator = 11;

// Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.
optional string df = 13;
optional string df = 12;

// A comma-separated list of fields to return as the docvalue representation for each hit.
repeated string docvalue_fields = 14;
repeated string docvalue_fields = 13;

// Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`.
repeated ExpandWildcard expand_wildcards = 15;

// If `true`, returns detailed information about score computation as part of a hit.
optional bool explain = 16;

// Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter.
optional int32 from = 17;
repeated ExpandWildcard expand_wildcards = 14;

// If `true`, concrete, expanded or aliased indexes will be ignored when frozen.
optional bool ignore_throttled = 18;
optional bool ignore_throttled = 15;

// If `false`, the request returns an error if it targets a missing or closed index.
optional bool ignore_unavailable = 19;

// 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)
optional bool include_named_queries_score = 20;

// If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the `q` query string parameter is specified.
optional bool lenient = 21;
optional bool ignore_unavailable = 16;

// Defines the number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
optional int32 max_concurrent_shard_requests = 22;
optional int32 max_concurrent_shard_requests = 17;

// Indicates whether to return phase-level `took` time values in the response.
optional bool phase_took = 23;
optional bool phase_took = 18;

// Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.
optional int32 pre_filter_shard_size = 24;
optional int32 pre_filter_shard_size = 19;

// Nodes and shards used for the search. By default, OpenSearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: `_only_local` to run the search only on shards on the local node; `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method; `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; `_shards:<shard>,<shard>` to run the search only on the specified shards; `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order.
optional string preference = 25;
optional string preference = 20;

// Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing.
optional string q = 26;
optional string q = 21;

// If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings.
optional bool request_cache = 27;
optional bool request_cache = 22;

// Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.
optional bool rest_total_hits_as_int = 28;
optional bool rest_total_hits_as_int = 23;

// A custom value used to route operations to a specific shard.
repeated string routing = 29;
repeated string routing = 24;

// Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting.
optional string scroll = 30;
optional string scroll = 25;

// Customizable sequence of processing stages applied to search queries.
optional string search_pipeline = 31;
optional string search_pipeline = 26;

// How distributed term frequencies are calculated for relevance scoring.
optional SearchType search_type = 32;

// If `true`, returns sequence number and primary term of the last modification of each hit.
optional bool seq_no_primary_term = 33;

// Defines the number of hits to return. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter.
optional int32 size = 34;

// A comma-separated list of <field>:<direction> pairs.
repeated string sort = 35;

// Specific `tag` of the request for logging and statistical purposes.
repeated string stats = 36;

// A comma-separated list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to `false`. You can pass `_source: true` to return both source fields and stored fields in the search response.
repeated string stored_fields = 37;
optional SearchType search_type = 27;

// Specifies which field to use for suggestions.
optional string suggest_field = 38;
optional string suggest_field = 28;

// Specifies the suggest mode. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
optional SuggestMode suggest_mode = 39;
optional SuggestMode suggest_mode = 29;

// Number of suggestions to return. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
optional int32 suggest_size = 40;
optional int32 suggest_size = 30;

// The source text for which the suggestions should be returned. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
optional string suggest_text = 41;

// Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early.
optional int32 terminate_after = 42;

// Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error.
optional string timeout = 43;

// If `true`, calculate and return document scores, even if the scores are not used for sorting.
optional bool track_scores = 44;

// Number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query.
optional TrackHits track_total_hits = 45;
optional string suggest_text = 31;

// If `true`, aggregation and suggester names are be prefixed by their respective types in the response.
optional bool typed_keys = 46;

// Enables or disables verbose mode for the search pipeline. When verbose mode is enabled, detailed information about each processor in the search pipeline is included in the search response. This includes the processor name, execution status, input, output, and time taken for processing. This parameter is primarily intended for debugging purposes, allowing users to track how data flows and transforms through the search pipeline.
optional bool verbose_pipeline = 47;

// If `true`, returns document version as part of a hit.
optional bool version = 48;
optional bool typed_keys = 32;

// Whether to pretty-format the returned JSON response.
optional bool pretty = 49;
optional bool pretty = 33;

// Whether to return human-readable values for statistics.
optional bool human = 50;
optional bool human = 34;

// Whether to include the stack trace of returned errors.
optional bool error_trace = 51;
optional bool error_trace = 35;

// The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
optional string source = 52;
optional string source = 36;

// A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
repeated string filter_path = 53;
repeated string filter_path = 37;

optional SearchRequest search_request = 54;
optional SearchRequest search_request = 38;
}

message SearchResponse {
Expand Down