diff --git a/server/src/main/proto/server/common/common.proto b/server/src/main/proto/server/common/common.proto new file mode 100644 index 0000000000000..43d4e1fb45e51 --- /dev/null +++ b/server/src/main/proto/server/common/common.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +package org.opensearch.common.proto; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; + +message IntArray{ + repeated int32 values = 1; +} + +message LongArray{ + repeated int64 values = 1; +} + +message FloatArray{ + repeated float values = 1; +} + +message DoubleArray{ + repeated double values = 1; +} + +message StringArray{ + repeated string values = 1; +} + +message BytesArray{ + repeated bytes values = 1; +} + +message BoolArray{ + repeated bool values = 1; +} + +/** + FieldValue: + description: A field value. + type: + - boolean + - 'null' + - number + - object + - string + */ +message MultiTypeValue{ + oneof value{ + GeneralNumber number = 1; + string string_value = 2; + bytes bytes_value = 3; + bool bool_value = 4; + } +} + +message GeneralNumber { + oneof value{ + int32 int_value = 1; + int64 long_value = 2; + float float_value = 3; + double double_value = 4; + } +} diff --git a/server/src/main/proto/server/search/aggregation_breakdown.proto b/server/src/main/proto/server/search/aggregation_breakdown.proto new file mode 100644 index 0000000000000..d1302bf249967 --- /dev/null +++ b/server/src/main/proto/server/search/aggregation_breakdown.proto @@ -0,0 +1,60 @@ +/* + * 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. + */ + +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message AggregationBreakdown { + + float build_aggregation = 1; + + float build_aggregation_count = 2; + + float build_leaf_collector = 3; + + float build_leaf_collector_count = 4; + + float collect = 5; + + float collect_count = 6; + + float initialize = 7; + + float initialize_count = 8; + + float post_collection = 9; + + float post_collection_count = 10; + + float reduce = 11; + + float reduce_count = 12; + +} diff --git a/server/src/main/proto/server/search/aggregation_profile.proto b/server/src/main/proto/server/search/aggregation_profile.proto new file mode 100644 index 0000000000000..4b85ab09da067 --- /dev/null +++ b/server/src/main/proto/server/search/aggregation_profile.proto @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/aggregation_breakdown.proto"; +import "server/search/aggregation_profile_debug.proto"; + +message AggregationProfile { + + AggregationBreakdown breakdown = 286857698; + + string description = 113933319; + + // Time unit for nanoseconds + float time_in_nanos = 94097879; + + string type = 3575610; + + AggregationProfileDebug debug = 95458899; + + repeated AggregationProfile children = 48913922; + +} diff --git a/server/src/main/proto/server/search/aggregation_profile_debug.proto b/server/src/main/proto/server/search/aggregation_profile_debug.proto new file mode 100644 index 0000000000000..0fe2013549044 --- /dev/null +++ b/server/src/main/proto/server/search/aggregation_profile_debug.proto @@ -0,0 +1,85 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/aggregation_profile_delegate_debug_filter.proto"; + +message AggregationProfileDebug { + + float segments_with_multi_valued_ords = 175102879; + + string collection_strategy = 208226316; + + float segments_with_single_valued_ords = 242809759; + + float total_buckets = 138939957; + + float built_buckets = 64814330; + + string result_strategy = 84288173; + + bool has_filter = 191100096; + + string delegate = 282451334; + + AggregationProfileDebug delegate_debug = 27647772; + + float chars_fetched = 505847418; + + float extract_count = 278565935; + + float extract_ns = 214678084; + + float values_fetched = 373640892; + + float collect_analyzed_ns = 371454153; + + float collect_analyzed_count = 519275104; + + float surviving_buckets = 510424761; + + float ordinals_collectors_used = 276182857; + + float ordinals_collectors_overhead_too_high = 528686757; + + float string_hashing_collectors_used = 344532608; + + float numeric_collectors_used = 290973279; + + float empty_collectors_used = 267779101; + + repeated string deferred_aggregators = 268219033; + + float segments_with_doc_count_field = 303272184; + + float segments_with_deleted_docs = 312342887; + + repeated AggregationProfileDelegateDebugFilter filters = 317676550; + + float segments_counted = 186950737; + + float segments_collected = 339150187; + + string map_reducer = 531896345; + +} diff --git a/server/src/main/proto/server/search/aggregation_profile_delegate_debug_filter.proto b/server/src/main/proto/server/search/aggregation_profile_delegate_debug_filter.proto new file mode 100644 index 0000000000000..2c40276904aa6 --- /dev/null +++ b/server/src/main/proto/server/search/aggregation_profile_delegate_debug_filter.proto @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message AggregationProfileDelegateDebugFilter { + + float results_from_metadata = 132154472; + + string query = 107944136; + + string specialized_for = 208110253; + + float segments_counted_in_constant_time = 474566367; + +} diff --git a/server/src/main/proto/server/search/collector.proto b/server/src/main/proto/server/search/collector.proto new file mode 100644 index 0000000000000..ac625754ae084 --- /dev/null +++ b/server/src/main/proto/server/search/collector.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message Collector { + + string name = 3373707; + + string reason = 398093757; + + // Time unit for nanoseconds + float time_in_nanos = 94097879; + + repeated Collector children = 48913922; + +} diff --git a/server/src/main/proto/server/search/date_decay_function.proto b/server/src/main/proto/server/search/date_decay_function.proto new file mode 100644 index 0000000000000..5c2136cbcf9fc --- /dev/null +++ b/server/src/main/proto/server/search/date_decay_function.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +// TODO + +message DateDecayFunction { + + // MultiValueMode multi_value_mode = 466997881; + +} diff --git a/server/src/main/proto/server/search/date_range_query.proto b/server/src/main/proto/server/search/date_range_query.proto new file mode 100644 index 0000000000000..958c083a17775 --- /dev/null +++ b/server/src/main/proto/server/search/date_range_query.proto @@ -0,0 +1,53 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/range_relation.proto"; +import "google/protobuf/wrappers.proto"; + +message DateRangeQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + RangeRelation relation = 17565189; + + string gt = 3309; + + string gte = 102680; + + string lt = 3464; + + string lte = 107485; + + string from = 3151786; + + string to = 3707; + + string format = 195037195; + + string time_zone = 36848094; + +} diff --git a/server/src/main/proto/server/search/decay_function.proto b/server/src/main/proto/server/search/decay_function.proto new file mode 100644 index 0000000000000..341ba2756a686 --- /dev/null +++ b/server/src/main/proto/server/search/decay_function.proto @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +// TODO +message DecayFunction { + + // MultiValueMode multi_value_mode = 466997881; + +} diff --git a/server/src/main/proto/server/search/decay_function_base.proto b/server/src/main/proto/server/search/decay_function_base.proto new file mode 100644 index 0000000000000..6f1f215073edf --- /dev/null +++ b/server/src/main/proto/server/search/decay_function_base.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +//TODO + +message DecayFunctionBase { + + // MultiValueMode multi_value_mode = 466997881; + +} diff --git a/server/src/main/proto/server/search/exists_query.proto b/server/src/main/proto/server/search/exists_query.proto new file mode 100644 index 0000000000000..995d6fbca273b --- /dev/null +++ b/server/src/main/proto/server/search/exists_query.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + +message ExistsQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 3; + +} diff --git a/server/src/main/proto/server/search/expand_wild_card.proto b/server/src/main/proto/server/search/expand_wild_card.proto new file mode 100644 index 0000000000000..6d32612b0f71a --- /dev/null +++ b/server/src/main/proto/server/search/expand_wild_card.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +enum ExpandWildcardEnum { + ALL = 0; + CLOSED = 1; + HIDDEN = 2; + NONE = 3; + OPEN = 4; +} diff --git a/server/src/main/proto/server/search/fetch_profile.proto b/server/src/main/proto/server/search/fetch_profile.proto new file mode 100644 index 0000000000000..fd89c9d671631 --- /dev/null +++ b/server/src/main/proto/server/search/fetch_profile.proto @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/fetch_profile_breakdown.proto"; +import "server/search/fetch_profile_debug.proto"; + +message FetchProfile { + + string type = 3575610; + + string description = 113933319; + + // Time unit for nanoseconds + float time_in_nanos = 94097879; + + FetchProfileBreakdown breakdown = 286857698; + + FetchProfileDebug debug = 95458899; + + repeated FetchProfile children = 48913922; + +} diff --git a/server/src/main/proto/server/search/fetch_profile_breakdown.proto b/server/src/main/proto/server/search/fetch_profile_breakdown.proto new file mode 100644 index 0000000000000..0cc4e7d88aae3 --- /dev/null +++ b/server/src/main/proto/server/search/fetch_profile_breakdown.proto @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message FetchProfileBreakdown { + + float load_source = 365465196; + + float load_source_count = 33334948; + + float load_stored_fields = 333539526; + + float load_stored_fields_count = 407563855; + + float next_reader = 386933649; + + float next_reader_count = 428388450; + + float process_count = 39191362; + + float process = 309518737; + +} diff --git a/server/src/main/proto/server/search/fetch_profile_debug.proto b/server/src/main/proto/server/search/fetch_profile_debug.proto new file mode 100644 index 0000000000000..b5a9f0d2878b7 --- /dev/null +++ b/server/src/main/proto/server/search/fetch_profile_debug.proto @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message FetchProfileDebug { + + repeated string stored_fields = 27495128; + + float fast_path = 26993112; + +} diff --git a/server/src/main/proto/server/search/field_value_factor_modifier.proto b/server/src/main/proto/server/search/field_value_factor_modifier.proto new file mode 100644 index 0000000000000..fed74751aadb6 --- /dev/null +++ b/server/src/main/proto/server/search/field_value_factor_modifier.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum FieldValueFactorModifier { + FieldValueFactorModifier_LN = 0; + FieldValueFactorModifier_LN1P = 1; + FieldValueFactorModifier_LN2P = 2; + FieldValueFactorModifier_LOG = 3; + FieldValueFactorModifier_LOG1P = 4; + FieldValueFactorModifier_LOG2P = 5; + FieldValueFactorModifier_NONE = 6; + FieldValueFactorModifier_RECIPROCAL = 7; + FieldValueFactorModifier_SQRT = 8; + FieldValueFactorModifier_SQUARE = 9; +} diff --git a/server/src/main/proto/server/search/field_value_factor_score_function.proto b/server/src/main/proto/server/search/field_value_factor_score_function.proto new file mode 100644 index 0000000000000..be73fbb098fa9 --- /dev/null +++ b/server/src/main/proto/server/search/field_value_factor_score_function.proto @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/field_value_factor_modifier.proto"; + +message FieldValueFactorScoreFunction { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 97427706; + + // Optional factor to multiply the field value with. + float factor = 208406195; + + // Value used if the document doesn't have that field. The modifier and factor are still applied to it as though it were read from the document. + float missing = 532578663; + + FieldValueFactorModifier modifier = 78642474; + +} diff --git a/server/src/main/proto/server/search/function_boost_mode.proto b/server/src/main/proto/server/search/function_boost_mode.proto new file mode 100644 index 0000000000000..79beb5680f3bd --- /dev/null +++ b/server/src/main/proto/server/search/function_boost_mode.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum FunctionBoostMode { + FunctionBoostMode_AVG = 0; + FunctionBoostMode_MAX = 1; + FunctionBoostMode_MIN = 2; + FunctionBoostMode_MULTIPLY = 3; + FunctionBoostMode_REPLACE = 4; + FunctionBoostMode_SUM = 5; +} diff --git a/server/src/main/proto/server/search/function_score_mode.proto b/server/src/main/proto/server/search/function_score_mode.proto new file mode 100644 index 0000000000000..74ba23f6635e0 --- /dev/null +++ b/server/src/main/proto/server/search/function_score_mode.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum FunctionScoreMode { + FunctionScoreMode_AVG = 0; + FunctionScoreMode_FIRST = 1; + FunctionScoreMode_MAX = 2; + FunctionScoreMode_MIN = 3; + FunctionScoreMode_MULTIPLY = 4; + FunctionScoreMode_SUM = 5; +} diff --git a/server/src/main/proto/server/search/fuzzy_query.proto b/server/src/main/proto/server/search/fuzzy_query.proto new file mode 100644 index 0000000000000..72b2277a059cd --- /dev/null +++ b/server/src/main/proto/server/search/fuzzy_query.proto @@ -0,0 +1,54 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +import "google/protobuf/wrappers.proto"; + +message FuzzyQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Maximum number of variations created. + float max_expansions = 398396084; + + // Number of beginning characters left unchanged when creating expansions. + float prefix_length = 83305167; + + string rewrite = 27406734; + + // Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). + bool transpositions = 164948289; + + oneof fuzziness{ + string string_fuzziness = 1; + float number_fuzziness = 2; + } + oneof value { + string string_value = 3; + bool boolean_value = 4; + float number_value = 5; + } + +} diff --git a/server/src/main/proto/server/search/hit.proto b/server/src/main/proto/server/search/hit.proto new file mode 100644 index 0000000000000..92102ae0c9f24 --- /dev/null +++ b/server/src/main/proto/server/search/hit.proto @@ -0,0 +1,111 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/hit_explanation.proto"; +import "server/search/hit_sort_inner.proto"; +import "server/search/total_hits_relation.proto"; +import "server/search/nested_identity.proto"; +import "google/protobuf/any.proto"; + +message Hit { + + string _type = 91310105; + + string _index = 401110063; + + string _id = 94650; + + oneof _score{ + float number_score = 1; + string string_score = 2; + } + + HitExplanation _explanation = 117298089; + + map fields = 200966473; + + map highlight = 144339789; + + map inner_hits = 286379914; + + repeated string matched_queries = 12624718; + + NestedIdentity _nested = 48913945; + + repeated string _ignored = 184327277; + + map ignored_field_values = 372941228; + + string _shard = 392056099; + + string _node = 91121377; + + string _routing = 14219386; + + google.protobuf.Any _source = 201352509; + + float _seq_no = 191980227; + + float _primary_term = 3525226; + + float _version = 511392873; + + repeated HitSortInner sort = 3536286; + +} + +message IgnoredFieldValues { + repeated string ignored_field_values = 1; +} + +message Highlights { + repeated string Highlight = 2; +} + +message HitsMetadata { + + HitsMetadataTotal total = 110549828; + + repeated Hit hits = 3202880; + + oneof max_score{ + float number_max_score = 1; + string string_max_score = 2; + } + +} + +message HitsMetadataTotal { + + TotalHitsRelation relation = 17565189; + + float value = 111972721; + +} + +message InnerHitsResult { + + HitsMetadata hits = 3202880; + +} diff --git a/server/src/main/proto/server/search/hit_explanation.proto b/server/src/main/proto/server/search/hit_explanation.proto new file mode 100644 index 0000000000000..d64aeaa48ebff --- /dev/null +++ b/server/src/main/proto/server/search/hit_explanation.proto @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/hit_explanation_details_inner.proto"; + +message HitExplanation { + + string description = 113933319; + + repeated HitExplanationDetailsInner details = 483979844; + + float value = 111972721; + +} diff --git a/server/src/main/proto/server/search/hit_explanation_details_inner.proto b/server/src/main/proto/server/search/hit_explanation_details_inner.proto new file mode 100644 index 0000000000000..fbd3ddfd93f09 --- /dev/null +++ b/server/src/main/proto/server/search/hit_explanation_details_inner.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +message HitExplanationDetailsInner { + + string description = 113933319; + + repeated HitExplanationDetailsInner details = 483979844; + + float value = 111972721; + +} diff --git a/server/src/main/proto/server/search/hit_sort_inner.proto b/server/src/main/proto/server/search/hit_sort_inner.proto new file mode 100644 index 0000000000000..6753a7ac90992 --- /dev/null +++ b/server/src/main/proto/server/search/hit_sort_inner.proto @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +//manual generate +message HitSortInner { + oneof value{ + bool boolean_value = 1; + float number_value = 2; + string string_value = 3; + } +} diff --git a/server/src/main/proto/server/search/ids_query.proto b/server/src/main/proto/server/search/ids_query.proto new file mode 100644 index 0000000000000..97c3dc8855048 --- /dev/null +++ b/server/src/main/proto/server/search/ids_query.proto @@ -0,0 +1,30 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message IdsQuery { + + repeated string values = 286941919; + +} diff --git a/server/src/main/proto/server/search/intervals_filter_script.proto b/server/src/main/proto/server/search/intervals_filter_script.proto new file mode 100644 index 0000000000000..860de689fd6ca --- /dev/null +++ b/server/src/main/proto/server/search/intervals_filter_script.proto @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/any.proto"; + +message IntervalsFilterScript { + + // Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time. + map params = 458557051; + + enum LangEnum { + LangEnum_EXPRESSION = 0; + LangEnum_JAVA = 1; + LangEnum_MUSTACHE = 2; + LangEnum_PAINLESS = 3; + } + + LangEnum lang = 3314158; + + map options = 175733092; + + // The script source. + string source = 359634918; + + string id = 3355; + +} diff --git a/server/src/main/proto/server/search/intervals_fuzzy.proto b/server/src/main/proto/server/search/intervals_fuzzy.proto new file mode 100644 index 0000000000000..5e3c8b4fe9478 --- /dev/null +++ b/server/src/main/proto/server/search/intervals_fuzzy.proto @@ -0,0 +1,47 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +message IntervalsFuzzy { + + // Analyzer used to normalize the term. + string analyzer = 487568219; + + oneof fuzziness{ + string string_fuzziness = 1; + float number_fuzziness = 2; + } + + // Number of beginning characters left unchanged when creating expansions. + float prefix_length = 83305167; + + // The term to match. + string term = 3556460; + + // Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`). + bool transpositions = 164948289; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string use_field = 198293438; + +} diff --git a/server/src/main/proto/server/search/intervals_prefix.proto b/server/src/main/proto/server/search/intervals_prefix.proto new file mode 100644 index 0000000000000..e64e5defb6394 --- /dev/null +++ b/server/src/main/proto/server/search/intervals_prefix.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message IntervalsPrefix { + + // Analyzer used to analyze the `prefix`. + string analyzer = 1; + + // Beginning characters of terms you wish to find in the top-level field. + string prefix = 2; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string use_field = 3; + +} diff --git a/server/src/main/proto/server/search/intervals_wildcard.proto b/server/src/main/proto/server/search/intervals_wildcard.proto new file mode 100644 index 0000000000000..59e4ad6923a74 --- /dev/null +++ b/server/src/main/proto/server/search/intervals_wildcard.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message IntervalsWildcard { + + // Analyzer used to analyze the `pattern`. Defaults to the top-level field's analyzer. + string analyzer = 1; + + // Wildcard pattern used to find matching terms. + string pattern = 2; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string use_field = 3; + +} diff --git a/server/src/main/proto/server/search/match_all_query.proto b/server/src/main/proto/server/search/match_all_query.proto new file mode 100644 index 0000000000000..ba83efaeb676f --- /dev/null +++ b/server/src/main/proto/server/search/match_all_query.proto @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + +message MatchAllQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + +} diff --git a/server/src/main/proto/server/search/match_bool_prefix_query.proto b/server/src/main/proto/server/search/match_bool_prefix_query.proto new file mode 100644 index 0000000000000..861c626c05a4e --- /dev/null +++ b/server/src/main/proto/server/search/match_bool_prefix_query.proto @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/operator.proto"; + +import "google/protobuf/wrappers.proto"; + +message MatchBoolPrefixQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + + // Analyzer used to convert the text in the query value into tokens. + string analyzer = 3; + + oneof fuzziness{ + string string_fuzziness = 4; + float number_fuzziness = 5; + } + + string fuzzy_rewrite = 6; + + // If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). Can be applied to the term subqueries constructed for all terms but the final term. + bool fuzzy_transpositions = 7; + + // Maximum number of terms to which the query will expand. Can be applied to the term subqueries constructed for all terms but the final term. + float max_expansions = 8; + + oneof minimum_should_match{ + float number_minimum_should_match = 9; + string string_minimum_should_match = 10; + } + + Operator operator = 11; + + // Number of beginning characters left unchanged for fuzzy matching. Can be applied to the term subqueries constructed for all terms but the final term. + float prefix_length = 12; + + // Terms you wish to find in the provided field. The last term is used in a prefix query. + string query = 13; + +} diff --git a/server/src/main/proto/server/search/match_none_query.proto b/server/src/main/proto/server/search/match_none_query.proto new file mode 100644 index 0000000000000..ad64c30b87818 --- /dev/null +++ b/server/src/main/proto/server/search/match_none_query.proto @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + + +message MatchNoneQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + +} diff --git a/server/src/main/proto/server/search/match_phrase_prefix_query.proto b/server/src/main/proto/server/search/match_phrase_prefix_query.proto new file mode 100644 index 0000000000000..aea64050a96d7 --- /dev/null +++ b/server/src/main/proto/server/search/match_phrase_prefix_query.proto @@ -0,0 +1,50 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/zero_terms_query.proto"; + +import "google/protobuf/wrappers.proto"; + +message MatchPhrasePrefixQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Analyzer used to convert text in the query value into tokens. + string analyzer = 487568219; + + // Maximum number of terms to which the last provided term of the query value will expand. + float max_expansions = 398396084; + + // Text you wish to find in the provided field. + string query = 107944136; + + // Maximum number of positions allowed between matching tokens. + float slop = 3533306; + + ZeroTermsQuery zero_terms_query = 327214331; + +} diff --git a/server/src/main/proto/server/search/match_phrase_query.proto b/server/src/main/proto/server/search/match_phrase_query.proto new file mode 100644 index 0000000000000..f0f44daa5fb47 --- /dev/null +++ b/server/src/main/proto/server/search/match_phrase_query.proto @@ -0,0 +1,46 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/zero_terms_query.proto"; +import "google/protobuf/wrappers.proto"; + +message MatchPhraseQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Analyzer used to convert the text in the query value into tokens. + string analyzer = 487568219; + + // Query terms that are analyzed and turned into a phrase query. + string query = 107944136; + + // Maximum number of positions allowed between matching tokens. + float slop = 3533306; + + ZeroTermsQuery zero_terms_query = 327214331; + +} diff --git a/server/src/main/proto/server/search/multi_match_query.proto b/server/src/main/proto/server/search/multi_match_query.proto new file mode 100644 index 0000000000000..7c9a90c51440b --- /dev/null +++ b/server/src/main/proto/server/search/multi_match_query.proto @@ -0,0 +1,86 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/operator.proto"; +import "server/search/text_query_type.proto"; +import "server/search/zero_terms_query.proto"; +import "google/protobuf/wrappers.proto"; + +message MultiMatchQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Analyzer used to convert the text in the query value into tokens. + string analyzer = 487568219; + + // If `true`, match phrase queries are automatically created for multi-term synonyms. + bool auto_generate_synonyms_phrase_query = 192041457; + + float cutoff_frequency = 385558410; + + repeated string fields = 200966473; + + oneof fuzziness{ + string string_fuzziness = 1; + float number_fuzziness = 2; + } + + string fuzzy_rewrite = 286485418; + + // If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). Can be applied to the term subqueries constructed for all terms but the final term. + bool fuzzy_transpositions = 195229289; + + // If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + bool lenient = 62509943; + + // Maximum number of terms to which the query will expand. + float max_expansions = 398396084; + + oneof minimum_should_match{ + float number_minimum_should_match = 3; + string string_minimum_should_match = 4; + } + + Operator operator = 500553564; + + // Number of beginning characters left unchanged for fuzzy matching. + float prefix_length = 83305167; + + // Text, number, boolean value or date you wish to find in the provided field. + string query = 107944136; + + // Maximum number of positions allowed between matching tokens. + float slop = 3533306; + + // Determines how scores for each per-term blended query and scores across groups are combined. + float tie_breaker = 38274757; + + TextQueryType type = 3575610; + + ZeroTermsQuery zero_terms_query = 327214331; + +} diff --git a/server/src/main/proto/server/search/nested_identity.proto b/server/src/main/proto/server/search/nested_identity.proto new file mode 100644 index 0000000000000..0340c278918d1 --- /dev/null +++ b/server/src/main/proto/server/search/nested_identity.proto @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message NestedIdentity { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 97427706; + + float offset = 482909038; + + NestedIdentity _nested = 48913945; + +} diff --git a/server/src/main/proto/server/search/number_range_query.proto b/server/src/main/proto/server/search/number_range_query.proto new file mode 100644 index 0000000000000..30e579cea7a69 --- /dev/null +++ b/server/src/main/proto/server/search/number_range_query.proto @@ -0,0 +1,59 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/range_relation.proto"; +import "google/protobuf/wrappers.proto"; + +message NumberRangeQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + + RangeRelation relation = 3; + + // Greater than. + float gt = 4; + + // Greater than or equal to. + float gte = 5; + + // Less than. + float lt = 6; + + // Less than or equal to. + float lte = 7; + + oneof from { + string string_from = 8; + float number_from = 9; + } + + oneof to { + string string_to = 10; + float number_to = 11; + } + +} diff --git a/server/src/main/proto/server/search/operator.proto b/server/src/main/proto/server/search/operator.proto new file mode 100644 index 0000000000000..875c815c4ec37 --- /dev/null +++ b/server/src/main/proto/server/search/operator.proto @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum Operator { + AND = 0; + OR = 1; +} diff --git a/server/src/main/proto/server/search/prefix_query.proto b/server/src/main/proto/server/search/prefix_query.proto new file mode 100644 index 0000000000000..7a024008319df --- /dev/null +++ b/server/src/main/proto/server/search/prefix_query.proto @@ -0,0 +1,42 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + +message PrefixQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + string rewrite = 27406734; + + // Beginning characters of terms you wish to find in the provided field. + string value = 111972721; + + // Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`. Default is `false` which means the case sensitivity of matching depends on the underlying field's mapping. + bool case_insensitive = 136000383; + +} diff --git a/server/src/main/proto/server/search/profile.proto b/server/src/main/proto/server/search/profile.proto new file mode 100644 index 0000000000000..17eed02009d65 --- /dev/null +++ b/server/src/main/proto/server/search/profile.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/shard_profile.proto"; + +message Profile { + + repeated ShardProfile shards = 366695340; + +} diff --git a/server/src/main/proto/server/search/query_base.proto b/server/src/main/proto/server/search/query_base.proto new file mode 100644 index 0000000000000..f9a643af19f8a --- /dev/null +++ b/server/src/main/proto/server/search/query_base.proto @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +import "google/protobuf/wrappers.proto"; + + +message QueryBase { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + +} diff --git a/server/src/main/proto/server/search/query_breakdown.proto b/server/src/main/proto/server/search/query_breakdown.proto new file mode 100644 index 0000000000000..8de1c284ed01f --- /dev/null +++ b/server/src/main/proto/server/search/query_breakdown.proto @@ -0,0 +1,64 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message QueryBreakdown { + + float advance = 57825152; + + float advance_count = 94538990; + + float build_scorer = 53521649; + + float build_scorer_count = 366130788; + + float create_weight = 185611496; + + float create_weight_count = 222855447; + + float match = 103668165; + + float match_count = 362178072; + + float shallow_advance = 276677291; + + float shallow_advance_count = 69358631; + + float next_doc = 350981614; + + float next_doc_count = 212852484; + + float score = 109264530; + + float score_count = 229522725; + + float compute_max_score = 381577745; + + float compute_max_score_count = 531815104; + + float set_min_competitive_score = 297872362; + + float set_min_competitive_score_count = 299297241; + +} diff --git a/server/src/main/proto/server/search/query_container.proto b/server/src/main/proto/server/search/query_container.proto new file mode 100644 index 0000000000000..c76afb69a7c60 --- /dev/null +++ b/server/src/main/proto/server/search/query_container.proto @@ -0,0 +1,338 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/intervals_fuzzy.proto"; +import "server/search/intervals_prefix.proto"; +import "server/search/intervals_wildcard.proto"; +import "server/search/intervals_filter_script.proto"; +import "server/search/exists_query.proto"; +import "server/search/fuzzy_query.proto"; +import "server/search/ids_query.proto"; +import "server/search/prefix_query.proto"; +import "server/search/range_query.proto"; +import "server/search/regexp_query.proto"; +import "server/search/terms_query.proto"; +import "server/search/terms_set_query.proto"; +import "server/search/wildcard_query.proto"; +import "server/search/query_container_term_value.proto"; +import "server/search/match_bool_prefix_query.proto"; +import "server/search/match_none_query.proto"; +import "server/search/match_phrase_prefix_query.proto"; +import "server/search/match_phrase_query.proto"; +import "server/search/multi_match_query.proto"; +import "server/search/query_container_match_value.proto"; +import "server/search/query_string_query.proto"; +import "server/search/simple_query_string_query.proto"; +import "server/search/function_boost_mode.proto"; +import "server/search/function_score_mode.proto"; +import "server/search/decay_function.proto"; +import "server/search/field_value_factor_score_function.proto"; +import "server/search/random_score_function.proto"; +import "server/search/match_all_query.proto"; +import "google/protobuf/wrappers.proto"; + +message QueryContainer { + + ExistsQuery exists = 1; + + // Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. + map fuzzy = 2; + + IdsQuery ids = 3; + + // Returns documents that contain a specific prefix in a provided field. + map prefix = 4; + + // Returns documents that contain terms within a provided range. + map range = 5; + + // Returns documents that contain terms matching a regular expression. + map regexp = 6; + + // Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization. + map term = 7; + + //TODO: missing def in https://github.com/opensearch-project/opensearch-api-specification/blob/main/spec/schemas/_common.query_dsl.yaml#L1851 + map terms = 8; + + // Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of terms must exactly match the field values, including whitespace and capitalization. + map terms_set = 9; + + // Returns documents that contain terms matching a wildcard pattern. + map wildcard = 10; + + // Returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching. + map match = 11; + + // Analyzes its input and constructs a `bool` query from the terms. Each term except the last is used in a `term` query. The last term is used in a prefix query. + map match_bool_prefix = 12; + + // Analyzes the text and creates a phrase query out of the analyzed text. + map match_phrase = 13; + + // Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term. + map match_phrase_prefix = 14; + + MultiMatchQuery multi_match = 15; + + QueryStringQuery query_string = 16; + + SimpleQueryStringQuery simple_query_string = 17; + + // Returns documents based on the order and proximity of matching terms. + map intervals = 18; + + MatchAllQuery match_all = 19; + + MatchNoneQuery match_none = 20; + + BoolQuery bool = 21; + + BoostingQuery boosting = 22; + + ConstantScoreQuery constant_score = 23; + + DisMaxQuery dis_max = 24; + + FunctionScoreQuery function_score = 25; + +} + +message BoolQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue _name = 91108202; + + // The clause (query) must appear in matching documents. However, unlike `must`, the score of the query will be ignored. + repeated QueryContainer filter = 200750218; + + oneof minimum_should_match{ + float number_minimum_should_match = 3; + string string_minimum_should_match = 4; + } + + // The clause (query) must appear in matching documents and will contribute to the score. + repeated QueryContainer must = 3363337; + + // The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of `0` is returned for all documents. + repeated QueryContainer must_not = 317063070; + + // The clause (query) should appear in the matching document. + repeated QueryContainer should = 366275150; + +} + +message BoostingQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the `negative` query. + float negative_boost = 204613866; + + QueryContainer negative = 384240694; + + QueryContainer positive = 210934266; + +} + +message ConstantScoreQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + QueryContainer filter = 200750218; + +} + +message DisMaxQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // One or more query clauses. Returned documents must match one or more of these queries. If a document matches multiple queries, OpenSearch uses the highest relevance score. + repeated QueryContainer queries = 118216551; + + // Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. + float tie_breaker = 38274757; + +} + +message FunctionScoreQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + FunctionBoostMode boost_mode = 121150658; + + // One or more functions that compute a new score for each document returned by the query. + repeated FunctionScoreContainer functions = 140572773; + + // Restricts the new score to not exceed the provided limit. + float max_boost = 250179320; + + // Excludes documents that do not meet the provided score threshold. + float min_score = 770662; + + QueryContainer query = 107944136; + + FunctionScoreMode score_mode = 509935410; + +} + +message IntervalsAllOf { + + // An array of rules to combine. All rules must produce a match in a document for the overall source to match. + repeated IntervalsContainer intervals = 503100494; + + // Maximum number of positions between the matching terms. Intervals produced by the rules further apart than this are not considered matches. + float max_gaps = 407707224; + + // If `true`, intervals produced by the rules should appear in the order in which they are specified. + bool ordered = 133367701; + + IntervalsFilter filter = 200750218; + +} + + + +message IntervalsAnyOf { + + // An array of rules to match. + repeated IntervalsContainer intervals = 503100494; + + IntervalsFilter filter = 200750218; + +} + +message IntervalsMatch { + + // Analyzer used to analyze terms in the query. + string analyzer = 487568219; + + // Maximum number of positions between the matching terms. Terms further apart than this are not considered matches. + float max_gaps = 407707224; + + // If `true`, matching terms must appear in their specified order. + bool ordered = 133367701; + + // Text you wish to find in the provided field. + string query = 107944136; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string use_field = 198293438; + + IntervalsFilter filter = 200750218; + +} + + +message IntervalsQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + IntervalsAllOf all_of = 341145293; + + IntervalsAnyOf any_of = 338910968; + + IntervalsFuzzy fuzzy = 97805834; + + IntervalsMatch match = 103668165; + + IntervalsPrefix prefix = 443239791; + + IntervalsWildcard wildcard = 99273256; + +} + +message FunctionScoreContainer { + + QueryContainer filter = 200750218; + + float weight = 254721417; + + DecayFunction exp = 100893; + + DecayFunction gauss = 98128507; + + DecayFunction linear = 28930269; + + FieldValueFactorScoreFunction field_value_factor = 97698563; + + RandomScoreFunction random_score = 212424682; + +} + + +message IntervalsFilter { + + IntervalsContainer after = 92734940; + + IntervalsContainer before = 319144067; + + IntervalsContainer contained_by = 530639782; + + IntervalsContainer containing = 145248910; + + IntervalsContainer not_contained_by = 495982992; + + IntervalsContainer not_containing = 505547643; + + IntervalsContainer not_overlapping = 17608400; + + IntervalsContainer overlapping = 414234055; + + IntervalsFilterScript script = 370814774; + +} + +message IntervalsContainer { + + IntervalsAllOf all_of = 341145293; + + IntervalsAnyOf any_of = 338910968; + + IntervalsFuzzy fuzzy = 97805834; + + IntervalsMatch match = 103668165; + + IntervalsPrefix prefix = 443239791; + + IntervalsWildcard wildcard = 99273256; + +} diff --git a/server/src/main/proto/server/search/query_container_match_value.proto b/server/src/main/proto/server/search/query_container_match_value.proto new file mode 100644 index 0000000000000..1122e82adc720 --- /dev/null +++ b/server/src/main/proto/server/search/query_container_match_value.proto @@ -0,0 +1,79 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/operator.proto"; +import "server/search/zero_terms_query.proto"; +import "google/protobuf/wrappers.proto"; + +message QueryContainerMatchValue { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Analyzer used to convert the text in the query value into tokens. + string analyzer = 487568219; + + // If `true`, match phrase queries are automatically created for multi-term synonyms. + bool auto_generate_synonyms_phrase_query = 192041457; + + float cutoff_frequency = 385558410; + + oneof fuzziness{ + string string_fuzziness = 1; + float number_fuzziness = 2; + } + + string fuzzy_rewrite = 286485418; + + // If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + bool fuzzy_transpositions = 195229289; + + // If `true`, format-based errors, such as providing a text query value for a numeric field, are ignored. + bool lenient = 62509943; + + // Maximum number of terms to which the query will expand. + float max_expansions = 398396084; + + oneof minimum_should_match{ + float number_minimum_should_match = 3; + string string_minimum_should_match = 4; + } + + Operator operator = 500553564; + + // Number of beginning characters left unchanged for fuzzy matching. + float prefix_length = 83305167; + + + oneof query{ + string string_query = 5; + float number_query = 6; + bool boolean_query = 7; + } + + ZeroTermsQuery zero_terms_query = 327214331; + +} diff --git a/server/src/main/proto/server/search/query_container_term_value.proto b/server/src/main/proto/server/search/query_container_term_value.proto new file mode 100644 index 0000000000000..64bdeba241764 --- /dev/null +++ b/server/src/main/proto/server/search/query_container_term_value.proto @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; +import "server/common/common.proto"; + +message QueryContainerTermValue { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + + // The term to search for in the field specified in . A document is returned in the results only if its field value exactly matches the term, with the correct spacing and capitalization. + org.opensearch.common.proto.MultiTypeValue value = 3; + + // Allows ASCII case insensitive matching of the value with the indexed field values when set to `true`. When `false`, the case sensitivity of matching depends on the underlying field's mapping. + bool case_insensitive = 4; + +} diff --git a/server/src/main/proto/server/search/query_profile.proto b/server/src/main/proto/server/search/query_profile.proto new file mode 100644 index 0000000000000..f50445ad16406 --- /dev/null +++ b/server/src/main/proto/server/search/query_profile.proto @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/query_breakdown.proto"; + +message QueryProfile { + + QueryBreakdown breakdown = 286857698; + + string description = 113933319; + + // Time unit for nanoseconds + float time_in_nanos = 94097879; + + string type = 3575610; + + repeated QueryProfile children = 48913922; + +} diff --git a/server/src/main/proto/server/search/query_string_query.proto b/server/src/main/proto/server/search/query_string_query.proto new file mode 100644 index 0000000000000..0dbb972ce5df7 --- /dev/null +++ b/server/src/main/proto/server/search/query_string_query.proto @@ -0,0 +1,110 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/operator.proto"; +import "server/search/text_query_type.proto"; +import "google/protobuf/wrappers.proto"; + +message QueryStringQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // If `true`, the wildcard characters `*` and `?` are allowed as the first character of the query string. + bool allow_leading_wildcard = 95329577; + + // Analyzer used to convert text in the query string into tokens. + string analyzer = 487568219; + + // If `true`, the query attempts to analyze wildcard terms in the query string. + bool analyze_wildcard = 21315437; + + // If `true`, match phrase queries are automatically created for multi-term synonyms. + bool auto_generate_synonyms_phrase_query = 192041457; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string default_field = 230385022; + + Operator default_operator = 65930015; + + // If `true`, enable position increments in queries constructed from a `query_string` search. + bool enable_position_increments = 102412548; + + bool escape = 220430209; + + // Array of fields to search. Supports wildcards (`*`). + repeated string fields = 200966473; + + oneof fuzziness{ + string string_fuzziness = 1; + float number_fuzziness = 2; + } + + // Maximum number of terms to which the query expands for fuzzy matching. + float fuzzy_max_expansions = 428677084; + + // Number of beginning characters left unchanged for fuzzy matching. + float fuzzy_prefix_length = 32326724; + + string fuzzy_rewrite = 286485418; + + // If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + bool fuzzy_transpositions = 195229289; + + // If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + bool lenient = 62509943; + + // Maximum number of automaton states required for the query. + float max_determinized_states = 157571749; + + + oneof minimum_should_match{ + float number_minimum_should_match = 3; + string string_minimum_should_match = 4; + } + + // Maximum number of positions allowed between matching tokens for phrases. + float phrase_slop = 434524097; + + // Query string you wish to parse and use for search. + string query = 107944136; + + // Analyzer used to convert quoted text in the query string into tokens. For quoted text, this parameter overrides the analyzer specified in the `analyzer` parameter. + string quote_analyzer = 339817721; + + // Suffix appended to quoted text in the query string. You can use this suffix to use a different analysis method for exact matches. + string quote_field_suffix = 142361832; + + string rewrite = 27406734; + + // How to combine the queries generated from the individual search terms in the resulting `dis_max` query. + float tie_breaker = 38274757; + + string time_zone = 36848094; + + TextQueryType type = 3575610; + +} diff --git a/server/src/main/proto/server/search/random_score_function.proto b/server/src/main/proto/server/search/random_score_function.proto new file mode 100644 index 0000000000000..ed510136235e9 --- /dev/null +++ b/server/src/main/proto/server/search/random_score_function.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message RandomScoreFunction { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 97427706; + + + oneof seed { + float number_seed = 1; + string string_seed = 2; + } + +} diff --git a/server/src/main/proto/server/search/range_query.proto b/server/src/main/proto/server/search/range_query.proto new file mode 100644 index 0000000000000..78f89859f655c --- /dev/null +++ b/server/src/main/proto/server/search/range_query.proto @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/date_range_query.proto"; +import "server/search/number_range_query.proto"; + +//manual generate +message RangeQuery { + + DateRangeQuery dataRangeQuery = 1; + + NumberRangeQuery numberRangeQuery = 2; + +} diff --git a/server/src/main/proto/server/search/range_relation.proto b/server/src/main/proto/server/search/range_relation.proto new file mode 100644 index 0000000000000..5786cfa193ae2 --- /dev/null +++ b/server/src/main/proto/server/search/range_relation.proto @@ -0,0 +1,30 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum RangeRelation { + RangeRelation_CONTAINS = 0; + RangeRelation_INTERSECTS = 1; + RangeRelation_WITHIN = 2; +} diff --git a/server/src/main/proto/server/search/regexp_query.proto b/server/src/main/proto/server/search/regexp_query.proto new file mode 100644 index 0000000000000..7894ee83b1aef --- /dev/null +++ b/server/src/main/proto/server/search/regexp_query.proto @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + +message RegexpQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Allows case insensitive matching of the regular expression value with the indexed field values when set to `true`. When `false`, case sensitivity of matching depends on the underlying field's mapping. + bool case_insensitive = 136000383; + + // Enables optional operators for the regular expression. + string flags = 97513095; + + // Maximum number of automaton states required for the query. + float max_determinized_states = 157571749; + + string rewrite = 27406734; + + // Regular expression for terms you wish to find in the provided field. + string value = 111972721; + +} diff --git a/server/src/main/proto/server/search/request_body.proto b/server/src/main/proto/server/search/request_body.proto new file mode 100644 index 0000000000000..5253692694dcc --- /dev/null +++ b/server/src/main/proto/server/search/request_body.proto @@ -0,0 +1,132 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/query_container.proto"; +import "server/search/search_request_highlight.proto"; +import "server/search/search_request_field_and_format.proto"; +import "server/search/search_request_script_fields.proto"; +import "server/search/search_request_source.proto"; +import "server/search/search_request_knn_inner.proto"; +import "server/search/search_request_pit.proto"; +import "server/search/search_request_rank.proto"; +import "server/search/search_request_rescore.proto"; +import "server/search/search_request_runtime_mappings_value.proto"; +import "server/search/search_request_slice.proto"; +import "server/search/search_request_suggest.proto"; +import "server/search/search_request_sort.proto"; +import "server/common/common.proto"; +import "google/protobuf/wrappers.proto"; + + +message RequestBody { + + // If true, returns detailed information about score computation as part of a hit. + bool explain = 1; + + // 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. + int32 from = 2; + + SearchRequestHighlight highlight = 3; + + oneof track_total_hits{ + bool boolean_track_total_hits = 4; + float number_track_total_hits = 6; + } + + // Boosts the _score of documents from specified indices. + repeated IndicesBoosts indices_boost = 7; + + // Array of wildcard (`*`) patterns. The request returns doc values for field names matching these patterns in the `hits.fields` property of the response. + repeated FieldAndFormat docvalue_fields = 8; + + // Defines the approximate kNN search to run. + repeated SearchRequestKnnInner knn = 9; + + // TODO: unclear RankContainer definition in specs + SearchRequestRank rank = 10; + + // Minimum `_score` for matching documents. Documents with a lower `_score` are not included in the search results. + int32 min_score = 11; + + QueryContainer post_filter = 12; + + // Set to `true` to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution. + bool profile = 13; + + // The DSL query to use in the request. + QueryContainer query = 14; + + // Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. + repeated SearchRequestRescore rescore = 15; + + // Retrieve a script evaluation (based on different fields) for each hit. + // TODO: not supported + map script_fields = 16; + + repeated org.opensearch.common.proto.MultiTypeValue search_after = 17; + + // 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. + int32 size = 18; + + SearchRequestSlice slice = 19; + + repeated SearchRequestSort sort = 20; + + // Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. + SearchRequestSource _source = 21; + + // Array of wildcard (`*`) patterns. The request returns values for field names matching these patterns in the `hits.fields` property of the response. + repeated FieldAndFormat fields = 22; + + SearchRequestSuggest suggest = 23; + + // 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 indices across multiple data tiers. If set to `0` (default), the query does not terminate early. + int32 terminate_after = 24; + + // 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. Defaults to no timeout. + string timeout = 25; + + // If true, calculate and return document scores, even if the scores are not used for sorting. + bool track_scores = 26; + + // If true, returns document version as part of a hit. + bool version = 27; + + // If `true`, returns sequence number and primary term of the last modification of each hit. + bool seq_no_primary_term = 28; + + repeated string stored_fields = 29; + + SearchRequestPit pit = 30; + + map runtime_mappings = 31; + + // Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API. + repeated string stats = 32; + +} + +message IndicesBoosts{ + map indices_boosts = 1; +} diff --git a/server/src/main/proto/server/search/response_body_clusters.proto b/server/src/main/proto/server/search/response_body_clusters.proto new file mode 100644 index 0000000000000..5f5e01f858b2d --- /dev/null +++ b/server/src/main/proto/server/search/response_body_clusters.proto @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/response_body_clusters_details_value.proto"; + +message ResponseBodyClusters { + + float skipped = 536831795; + + float successful = 196760935; + + float total = 110549828; + + float running = 477042113; + + float partial = 256063104; + + float failed = 208235461; + + map details = 483979844; + +} diff --git a/server/src/main/proto/server/search/response_body_clusters_details_value.proto b/server/src/main/proto/server/search/response_body_clusters_details_value.proto new file mode 100644 index 0000000000000..3f74cbefe22da --- /dev/null +++ b/server/src/main/proto/server/search/response_body_clusters_details_value.proto @@ -0,0 +1,51 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/response_body_shards.proto"; +import "server/search/response_body_shards_failures_inner.proto"; + +message ResponseBodyClustersDetailsValue { + + enum StatusEnum { + StatusEnum_FAILED = 0; + StatusEnum_PARTIAL = 1; + StatusEnum_RUNNING = 2; + StatusEnum_SKIPPED = 3; + StatusEnum_SUCCESSFUL = 4; + } + + StatusEnum status = 355610639; + + string indices = 332778410; + + // Time unit for milliseconds + float took = 3565975; + + bool timed_out = 40661574; + + ResponseBodyShards _shards = 194292087; + + repeated ResponseBodyShardsFailuresInner failures = 139067434; + +} diff --git a/server/src/main/proto/server/search/response_body_phase_took.proto b/server/src/main/proto/server/search/response_body_phase_took.proto new file mode 100644 index 0000000000000..1ec885340cfc0 --- /dev/null +++ b/server/src/main/proto/server/search/response_body_phase_took.proto @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message ResponseBodyPhaseTook { + + float dfs_pre_query = 1; + + float query = 2; + + float fetch = 3; + + float dfs_query = 4; + + float expand = 5; + + float can_match = 6; + +} diff --git a/server/src/main/proto/server/search/response_body_shards.proto b/server/src/main/proto/server/search/response_body_shards.proto new file mode 100644 index 0000000000000..1b4673948223c --- /dev/null +++ b/server/src/main/proto/server/search/response_body_shards.proto @@ -0,0 +1,39 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/response_body_shards_failures_inner.proto"; + +message ResponseBodyShards { + + float failed = 1; + + float successful = 2; + + float total = 3; + + repeated ResponseBodyShardsFailuresInner failures = 4; + + float skipped = 5; + +} diff --git a/server/src/main/proto/server/search/response_body_shards_failures_inner.proto b/server/src/main/proto/server/search/response_body_shards_failures_inner.proto new file mode 100644 index 0000000000000..13694154ac4a1 --- /dev/null +++ b/server/src/main/proto/server/search/response_body_shards_failures_inner.proto @@ -0,0 +1,39 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/response_body_shards_failures_inner_reason.proto"; + +message ResponseBodyShardsFailuresInner { + + string index = 100346066; + + string node = 3386882; + + ResponseBodyShardsFailuresInnerReason reason = 398093757; + + float shard = 109400030; + + string status = 355610639; + +} diff --git a/server/src/main/proto/server/search/response_body_shards_failures_inner_reason.proto b/server/src/main/proto/server/search/response_body_shards_failures_inner_reason.proto new file mode 100644 index 0000000000000..07f957bcf66b6 --- /dev/null +++ b/server/src/main/proto/server/search/response_body_shards_failures_inner_reason.proto @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message ResponseBodyShardsFailuresInnerReason { + + // The type of error + string type = 3575610; + + // A human-readable explanation of the error, in english + string reason = 398093757; + + // The server stack trace. Present only if the `error_trace=true` parameter was sent with the request. + string stack_trace = 218820404; + + ResponseBodyShardsFailuresInnerReason caused_by = 369263111; + + repeated ResponseBodyShardsFailuresInnerReason root_cause = 49076534; + + repeated ResponseBodyShardsFailuresInnerReason suppressed = 3155437; + +} diff --git a/server/src/main/proto/server/search/search_profile.proto b/server/src/main/proto/server/search/search_profile.proto new file mode 100644 index 0000000000000..9d85bcd05b461 --- /dev/null +++ b/server/src/main/proto/server/search/search_profile.proto @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/collector.proto"; +import "server/search/query_profile.proto"; + +message SearchProfile { + + repeated Collector collector = 272878736; + + repeated QueryProfile query = 107944136; + + float rewrite_time = 90960288; + +} diff --git a/server/src/main/proto/server/search/search_request.proto b/server/src/main/proto/server/search/search_request.proto new file mode 100644 index 0000000000000..8352808c6a7c4 --- /dev/null +++ b/server/src/main/proto/server/search/search_request.proto @@ -0,0 +1,137 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/request_body.proto"; +import "google/protobuf/timestamp.proto"; +import "server/common/common.proto"; +import "server/search/expand_wild_card.proto"; + +message StringArray{ + repeated string values = 1; +} + +message SearchRequest { + // Indicates which source fields are returned for matching documents. These fields are returned in the `hits._source` property of the search response. Valid values are: `true` to return the entire document source; `false` to not return the document source; `` to return the source fields that are specified as a comma-separated list (supports wildcard (`*`) patterns). + oneof _source { + bool boolean_source = 47; + org.opensearch.common.proto.StringArray fields = 48; + } + // A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. + org.opensearch.common.proto.StringArray sourceExcludes = 2; + // A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. + org.opensearch.common.proto.StringArray sourceIncludes = 3; + // If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + bool allowNoIndices = 4; + // If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. + bool allowPartialSearchResults = 5; + // If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified. + bool analyzeWildcard = 6; + // Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified. + string analyzer = 7; + // 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. + int32 batchedReduceSize = 8; + // The time after which the search request will be canceled. Request-level parameter takes precedence over `cancel_after_time_interval` cluster setting. + string cancelAfterTimeInterval = 9; + // If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. + bool ccsMinimizeRoundtrips = 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. + string defaultOperator = 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. + string df = 12; + // A comma-separated list of fields to return as the docvalue representation for each hit. + org.opensearch.common.proto.StringArray docvalueFields = 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 ExpandWildcardEnum expandWildcards = 14; + // If `true`, returns detailed information about score computation as part of a hit. + bool explain = 15; + // 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. + int32 from = 16; + // If `true`, concrete, expanded or aliased indices will be ignored when frozen. + bool ignoreThrottled = 17; + // If `false`, the request returns an error if it targets a missing or closed index. + bool ignoreUnavailable = 18; + // 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) + bool includeNamedQueriesScore = 19; + // 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. + bool lenient = 20; + // 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. + int32 maxConcurrentShardRequests = 21; + // Indicates whether to return phase-level `took` time values in the response. + bool phaseTook = 22; + // 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. + int32 preFilterShardSize = 23; + // 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:,` 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:,` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; `_shards:,` to run the search only on the specified shards; `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order. + string preference = 24; + // 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. + string q = 25; + // If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings. + bool requestCache = 26; + // Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. + bool restTotalHitsAsInt = 27; + // Custom value used to route operations to a specific shard. + string routing = 28; + // 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. + google.protobuf.Timestamp scroll = 29; + // Customizable sequence of processing stages applied to search queries. + string searchPipeline = 30; + // How distributed term frequencies are calculated for relevance scoring. + string searchType = 31; + // If `true`, returns sequence number and primary term of the last modification of each hit. + bool seqNoPrimaryTerm = 32; + // 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. + int32 size = 33; + // A comma-separated list of : pairs. + repeated string sort = 34; + // Specific `tag` of the request for logging and statistical purposes. + repeated string stats = 35; + // 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 storedFields = 36; + // Specifies which field to use for suggestions. + string suggestField = 37; + // Specifies the suggest mode. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. + string suggestMode = 38; + // Number of suggestions to return. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. + int32 suggestSize = 39; + // 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. + string suggestText = 40; + // 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 indices across multiple data tiers. If set to `0` (default), the query does not terminate early. + int32 terminateAfter = 41; + // 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. + google.protobuf.Timestamp timeout = 42; + // If `true`, calculate and return document scores, even if the scores are not used for sorting. + bool trackScores = 43; + // 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. + oneof trackTotalHits { + bool boolean_trackTotalHits = 50; + int32 number_trackTotalHits = 51; + } + // If `true`, aggregation and suggester names are be prefixed by their respective types in the response. + bool typedKeys = 45; + // If `true`, returns document version as part of a hit. + bool version = 46; + + //request body + RequestBody request_body = 52; +} + + diff --git a/server/src/main/proto/server/search/search_request_field_and_format.proto b/server/src/main/proto/server/search/search_request_field_and_format.proto new file mode 100644 index 0000000000000..81dfee0e4e55a --- /dev/null +++ b/server/src/main/proto/server/search/search_request_field_and_format.proto @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message FieldAndFormat { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 1; + + // Format in which the values are returned. + string format = 2; + + bool include_unmapped = 3; + +} diff --git a/server/src/main/proto/server/search/search_request_highlight.proto b/server/src/main/proto/server/search/search_request_highlight.proto new file mode 100644 index 0000000000000..c7f4ddd3c1c61 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_highlight.proto @@ -0,0 +1,250 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +import "server/search/query_container.proto"; +import "google/protobuf/any.proto"; + +message SearchRequestHighlight { + + HighlightBase base = 1; + + enum EncoderEnum { + DEFAULT = 0; + HTML = 1; + } + + EncoderEnum encoder = 2; + + // [required] + map fields = 3; + +} + +message HighlightBase { + enum TypeEnum { + FVH = 0; + PLAIN = 1; + UNIFIED = 2; + } + + TypeEnum type = 1; + + // A string that contains each boundary character. + string boundary_chars = 2; + + // How far to scan for boundary characters. + int32 boundary_max_scan = 3; + + enum Boundary_scannerEnum { + CHARS = 0; + SENTENCE = 1; + WORD = 2; + } + + Boundary_scannerEnum boundary_scanner = 4; + + // Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: `\"en-US\"`, `\"fr-FR\"`, `\"ja-JP\"`. + string boundary_scanner_locale = 5; + + bool force_source = 6; + + enum FragmenterEnum { + SIMPLE = 0; + SPAN = 1; + } + + FragmenterEnum fragmenter = 7; + + // The size of the highlighted fragment in characters. + int32 fragment_size = 8; + + bool highlight_filter = 9; + + QueryContainer highlight_query = 10; + + int32 max_fragment_length = 11; + + // If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it's set to lower value than the query setting. + int32 max_analyzed_offset = 12; + + // The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + int32 no_match_size = 13; + + // The maximum number of fragments to return. If the number of fragments is set to `0`, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If `number_of_fragments` is `0`, `fragment_size` is ignored. + int32 number_of_fragments = 14; + + /* + options: + type: object + additionalProperties: + type: object + */ + map options = 175733092; + + enum OrderEnum { + SCORE = 0; + } + + OrderEnum order = 15; + + // Controls the number of matching phrases in a document that are considered. Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory. When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the `fvh` highlighter. + int32 phrase_limit = 16; + + // Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in `` and `` tags. + repeated string post_tags = 17; + + // Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in `` and `` tags. + repeated string pre_tags = 18; + + // By default, only fields that contains a query match are highlighted. Set to `false` to highlight all fields. + bool require_field_match = 19; + + enum Tags_schemaEnum { + STYLED = 0; + } + + Tags_schemaEnum tags_schema = 20; + +} + +message HighlightFields { + + HighlightBase base = 1; + + int32 fragment_offset = 2; + + repeated string matched_fields = 3; + + HighlightAnalyzer analyzer = 4; + +} + +message HighlightAnalyzer { + + enum TypeEnum { + CUSTOM = 0; + FINGERPRINT = 1; + KEYWORD = 2; + LANGUAGE = 3; + NORI = 4; + PATTERN = 5; + SIMPLE = 6; + STANDARD = 7; + STOP = 8; + WHITESPACE = 9; + ICU_ANALYZER = 10; + KUROMOJI = 11; + SNOWBALL = 12; + DUTCH = 13; + } + + TypeEnum type = 1; + + repeated string char_filter = 2; + + repeated string filter = 3; + + float position_increment_gap = 4; + + float position_offset_gap = 5; + + string tokenizer = 6; + + string version = 7; + + float max_output_size = 8; + + bool preserve_original = 9; + + string separator = 10; + + repeated string stopwords = 11; + + string stopwords_path = 12; + + LanguageEnum language = 13; + + repeated string stem_exclusion = 14; + + enum Decompound_modeEnum { + DISCARD = 0; + MIXED = 1; + NONE = 2; + } + + Decompound_modeEnum decompound_mode = 15; + + repeated string stoptags = 16; + + string user_dictionary = 17; + + string flags = 18; + + bool lowercase = 19; + + string pattern = 20; + + float max_token_length = 21; + + enum MethodEnum { + NFC = 0; + NFKC = 1; + NFKC_CF = 2; + } + + MethodEnum method = 22; + + enum ModeEnum { + EXTENDED = 0; + NORMAL = 1; + SEARCH = 2; + } + + ModeEnum mode = 23; +} + + +enum LanguageEnum { + ARMENIAN = 0; + BASQUE = 1; + CATALAN = 2; + DANISH = 3; + DUTCH = 4; + ENGLISH = 5; + FINNISH = 6; + FRENCH = 7; + GERMAN = 8; + GERMAN2 = 9; + HUNGARIAN = 10; + ITALIAN = 11; + KP = 12; + LOVINS = 13; + NORWEGIAN = 14; + PORTER = 15; + PORTUGUESE = 16; + ROMANIAN = 17; + RUSSIAN = 18; + SPANISH = 19; + SWEDISH = 20; + TURKISH = 21; +} diff --git a/server/src/main/proto/server/search/search_request_knn_inner.proto b/server/src/main/proto/server/search/search_request_knn_inner.proto new file mode 100644 index 0000000000000..a0634ea218483 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_knn_inner.proto @@ -0,0 +1,52 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/query_container.proto"; +import "server/search/search_request_knn_inner_query_vector_builder.proto"; +import "google/protobuf/wrappers.proto"; + +message SearchRequestKnnInner { + + // [required] Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 1; + + repeated float query_vector = 2; + + SearchRequestKnnInnerQueryVectorBuilder query_vector_builder = 3; + + // [required] The final number of nearest neighbors to return as top hits + int32 k = 4; + + // [required] The number of nearest neighbor candidates to consider per shard + int32 num_candidates = 5; + + // Boost value to apply to kNN scores + .google.protobuf.FloatValue boost = 6; + + repeated QueryContainer filter = 7; + + // The minimum similarity for a vector to be considered a match + float similarity = 8; + +} diff --git a/server/src/main/proto/server/search/search_request_knn_inner_query_vector_builder.proto b/server/src/main/proto/server/search/search_request_knn_inner_query_vector_builder.proto new file mode 100644 index 0000000000000..87e6237958554 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_knn_inner_query_vector_builder.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/search_request_knn_text_embedding.proto"; + +message SearchRequestKnnInnerQueryVectorBuilder { + + SearchRequestKnnTextEmbedding text_embedding = 1; + +} diff --git a/server/src/main/proto/server/search/search_request_knn_text_embedding.proto b/server/src/main/proto/server/search/search_request_knn_text_embedding.proto new file mode 100644 index 0000000000000..d515face92c81 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_knn_text_embedding.proto @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SearchRequestKnnTextEmbedding { + + // [required] + string model_id = 1; + + // [required] + string model_text = 2; + +} diff --git a/server/src/main/proto/server/search/search_request_pit.proto b/server/src/main/proto/server/search/search_request_pit.proto new file mode 100644 index 0000000000000..27c99ae45f0ac --- /dev/null +++ b/server/src/main/proto/server/search/search_request_pit.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SearchRequestPit { + + string id = 1; + + // 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. + string keep_alive = 2; + +} diff --git a/server/src/main/proto/server/search/search_request_rank.proto b/server/src/main/proto/server/search/search_request_rank.proto new file mode 100644 index 0000000000000..2cd57702d5f4e --- /dev/null +++ b/server/src/main/proto/server/search/search_request_rank.proto @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +message SearchRequestRank { + + SearchRequestRankRrf rrf = 1; + +} + + +message SearchRequestRankRrf { + + // How much influence documents in individual result sets per query have over the final ranked result set + int32 rank_constant = 1; + + // Size of the individual result sets per query + int32 window_size = 2; + +} diff --git a/server/src/main/proto/server/search/search_request_rescore.proto b/server/src/main/proto/server/search/search_request_rescore.proto new file mode 100644 index 0000000000000..674aacdf15b4d --- /dev/null +++ b/server/src/main/proto/server/search/search_request_rescore.proto @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/search_request_rescore_inner_query.proto"; + +message SearchRequestRescore { + + // [required] + SearchRequestRescoreQuery query = 1; + + int32 window_size = 2; + +} diff --git a/server/src/main/proto/server/search/search_request_rescore_inner_query.proto b/server/src/main/proto/server/search/search_request_rescore_inner_query.proto new file mode 100644 index 0000000000000..6cff10d9ab01b --- /dev/null +++ b/server/src/main/proto/server/search/search_request_rescore_inner_query.proto @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/query_container.proto"; + +message SearchRequestRescoreQuery { + + // [required] + QueryContainer rescore_query = 1; + + // Relative importance of the original query versus the rescore query. + float query_weight = 2; + + // Relative importance of the rescore query versus the original query. + float rescore_query_weight = 3; + + enum Score_modeEnum { + Score_modeEnum_AVG = 0; + Score_modeEnum_MAX = 1; + Score_modeEnum_MIN = 2; + Score_modeEnum_MULTIPLY = 3; + Score_modeEnum_TOTAL = 4; + } + + Score_modeEnum score_mode = 4; + +} diff --git a/server/src/main/proto/server/search/search_request_runtime_mappings_value.proto b/server/src/main/proto/server/search/search_request_runtime_mappings_value.proto new file mode 100644 index 0000000000000..835179bae43ad --- /dev/null +++ b/server/src/main/proto/server/search/search_request_runtime_mappings_value.proto @@ -0,0 +1,59 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/search_request_runtime_mappings_value_fetch_fields_inner.proto"; + +message SearchRequestRuntimeMappingsValue { + + // For type `lookup` + repeated SearchRequestRuntimeMappingsValueFetchFieldsInner fetch_fields = 531648480; + + // A custom format for `date` type runtime fields. + string format = 195037195; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string input_field = 24370245; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string target_field = 210221876; + + string target_index = 207303516; + + //auto removed script + //SearchRequestHighlightAllOfHighlightQueryBoolAllOfFilterOneOfFunctionScoreAllOfFunctionsInnerAllOfScriptScoreScript script = 370814774; + + enum TypeEnum { + TypeEnum_BOOLEAN = 0; + TypeEnum_DATE = 1; + TypeEnum_DOUBLE = 2; + TypeEnum_GEO_POINT = 3; + TypeEnum_IP = 4; + TypeEnum_KEYWORD = 5; + TypeEnum_LONG = 6; + TypeEnum_LOOKUP = 7; + } + + TypeEnum type = 3575610; + +} diff --git a/server/src/main/proto/server/search/search_request_runtime_mappings_value_fetch_fields_inner.proto b/server/src/main/proto/server/search/search_request_runtime_mappings_value_fetch_fields_inner.proto new file mode 100644 index 0000000000000..55c7c0bd705b8 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_runtime_mappings_value_fetch_fields_inner.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SearchRequestRuntimeMappingsValueFetchFieldsInner { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 97427706; + + string format = 195037195; + +} diff --git a/server/src/main/proto/server/search/search_request_script_fields.proto b/server/src/main/proto/server/search/search_request_script_fields.proto new file mode 100644 index 0000000000000..f218c2886f65b --- /dev/null +++ b/server/src/main/proto/server/search/search_request_script_fields.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +// TODO: not supported +message SearchRequestScriptFields { + + //TODO + string script = 1; + + bool ignore_failure = 2; + +} diff --git a/server/src/main/proto/server/search/search_request_slice.proto b/server/src/main/proto/server/search/search_request_slice.proto new file mode 100644 index 0000000000000..e2baffb63d9ad --- /dev/null +++ b/server/src/main/proto/server/search/search_request_slice.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SearchRequestSlice { + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string field = 1; + + // [required] + string id = 2; + + // [required] + int32 max = 3; + +} diff --git a/server/src/main/proto/server/search/search_request_sort.proto b/server/src/main/proto/server/search/search_request_sort.proto new file mode 100644 index 0000000000000..48654b41c89e2 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_sort.proto @@ -0,0 +1,27 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +message SearchRequestSort { + oneof SortCombinations{ + string field = 1; + SortOptions sort_options = 2; + } + + message SortOptions { + SortOrder order = 1; + enum SortOrder { + ASC = 0; + DESC = 1; + } + } +} diff --git a/server/src/main/proto/server/search/search_request_source.proto b/server/src/main/proto/server/search/search_request_source.proto new file mode 100644 index 0000000000000..73657268f6b15 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_source.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +message SearchRequestSource { + + oneof SourceConfig { + bool config = 1; + string field = 2; + SourceFilter source_filter = 3; + } + + message SourceFilter { + repeated string excludes = 1; + repeated string includes = 2; + } +} diff --git a/server/src/main/proto/server/search/search_request_suggest.proto b/server/src/main/proto/server/search/search_request_suggest.proto new file mode 100644 index 0000000000000..ebe5d7a68fce5 --- /dev/null +++ b/server/src/main/proto/server/search/search_request_suggest.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + OpenSearch _core API + + OpenSearch _core API + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SearchRequestSuggest { + + // Global suggest text, to avoid repetition when the same text is used in several suggesters + string text = 1; + +} diff --git a/server/src/main/proto/server/search/search_response.proto b/server/src/main/proto/server/search/search_response.proto new file mode 100644 index 0000000000000..5e3df3dd0afca --- /dev/null +++ b/server/src/main/proto/server/search/search_response.proto @@ -0,0 +1,67 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/hit.proto"; +import "server/search/profile.proto"; +import "server/search/response_body_clusters.proto"; +import "server/search/response_body_phase_took.proto"; +import "server/search/response_body_shards.proto"; +import "server/search/suggest.proto"; +import "google/protobuf/any.proto"; + +message ResponseBody { + + float took = 1; + + bool timed_out = 2; + + ResponseBodyShards _shards = 3; + + ResponseBodyPhaseTook phase_took = 4; + + HitsMetadata hits = 5; + + ResponseBodyClusters _clusters = 6; + + map fields = 7; + + float max_score = 8; + + float num_reduce_phases = 9; + + Profile profile = 10; + + string pit_id = 11; + + string _scroll_id = 12; + + map suggest = 13; + + bool terminated_early = 14; + +} + +message Suggests{ + repeated Suggest suggests = 1; +} diff --git a/server/src/main/proto/server/search/shard_profile.proto b/server/src/main/proto/server/search/shard_profile.proto new file mode 100644 index 0000000000000..bd9b534aae7de --- /dev/null +++ b/server/src/main/proto/server/search/shard_profile.proto @@ -0,0 +1,39 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/aggregation_profile.proto"; +import "server/search/fetch_profile.proto"; +import "server/search/search_profile.proto"; + +message ShardProfile { + + repeated AggregationProfile aggregations = 317470161; + + string id = 3355; + + repeated SearchProfile searches = 351774807; + + FetchProfile fetch = 97322682; + +} diff --git a/server/src/main/proto/server/search/simple_query_string_flags.proto b/server/src/main/proto/server/search/simple_query_string_flags.proto new file mode 100644 index 0000000000000..deffb2a83922d --- /dev/null +++ b/server/src/main/proto/server/search/simple_query_string_flags.proto @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SimpleQueryStringFlags { + +} diff --git a/server/src/main/proto/server/search/simple_query_string_query.proto b/server/src/main/proto/server/search/simple_query_string_query.proto new file mode 100644 index 0000000000000..a346d24166a6d --- /dev/null +++ b/server/src/main/proto/server/search/simple_query_string_query.proto @@ -0,0 +1,74 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/operator.proto"; +import "server/search/simple_query_string_flags.proto"; +import "google/protobuf/wrappers.proto"; + +message SimpleQueryStringQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Analyzer used to convert text in the query string into tokens. + string analyzer = 487568219; + + // If `true`, the query attempts to analyze wildcard terms in the query string. + bool analyze_wildcard = 21315437; + + // If `true`, the parser creates a match_phrase query for each multi-position token. + bool auto_generate_synonyms_phrase_query = 192041457; + + Operator default_operator = 65930015; + + // Array of fields you wish to search. Accepts wildcard expressions. You also can boost relevance scores for matches to particular fields using a caret (`^`) notation. Defaults to the `index.query.default_field index` setting, which has a default value of `*`. + repeated string fields = 200966473; + + SimpleQueryStringFlags flags = 97513095; + + // Maximum number of terms to which the query expands for fuzzy matching. + float fuzzy_max_expansions = 428677084; + + // Number of beginning characters left unchanged for fuzzy matching. + float fuzzy_prefix_length = 32326724; + + // If `true`, edits for fuzzy matching include transpositions of two adjacent characters (for example, `ab` to `ba`). + bool fuzzy_transpositions = 195229289; + + // If `true`, format-based errors, such as providing a text value for a numeric field, are ignored. + bool lenient = 62509943; + + oneof minimum_should_match{ + float number_minimum_should_match = 3; + string string_minimum_should_match = 4; + } + // Query string in the simple query string syntax you wish to parse and use for search. + string query = 107944136; + + // Suffix appended to quoted text in the query string. + string quote_field_suffix = 142361832; + +} diff --git a/server/src/main/proto/server/search/suggest.proto b/server/src/main/proto/server/search/suggest.proto new file mode 100644 index 0000000000000..1638246e159e2 --- /dev/null +++ b/server/src/main/proto/server/search/suggest.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/term_suggest_all_of_options.proto"; + +message Suggest { + + float length = 32621852; + + float offset = 482909038; + + string text = 3556653; + + TermSuggestAllOfOptions options = 175733092; + +} diff --git a/server/src/main/proto/server/search/suggest_base.proto b/server/src/main/proto/server/search/suggest_base.proto new file mode 100644 index 0000000000000..7c4919aeeecf7 --- /dev/null +++ b/server/src/main/proto/server/search/suggest_base.proto @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message SuggestBase { + + float length = 32621852; + + float offset = 482909038; + + string text = 3556653; + +} diff --git a/server/src/main/proto/server/search/suggester.proto b/server/src/main/proto/server/search/suggester.proto new file mode 100644 index 0000000000000..0bcdacc413f11 --- /dev/null +++ b/server/src/main/proto/server/search/suggester.proto @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +message Suggester { + + // Global suggest text, to avoid repetition when the same text is used in several suggesters + string text = 3556653; + +} diff --git a/server/src/main/proto/server/search/term_suggest.proto b/server/src/main/proto/server/search/term_suggest.proto new file mode 100644 index 0000000000000..21edb9aa2860f --- /dev/null +++ b/server/src/main/proto/server/search/term_suggest.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "server/search/term_suggest_all_of_options.proto"; + +message TermSuggest { + + float length = 32621852; + + float offset = 482909038; + + string text = 3556653; + + TermSuggestAllOfOptions options = 175733092; + +} diff --git a/server/src/main/proto/server/search/term_suggest_all_of_options.proto b/server/src/main/proto/server/search/term_suggest_all_of_options.proto new file mode 100644 index 0000000000000..6699d7e50b6b0 --- /dev/null +++ b/server/src/main/proto/server/search/term_suggest_all_of_options.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +message TermSuggestAllOfOptions { + + string text = 3556653; + + float score = 109264530; + + float freq = 3151480; + + string highlighted = 197837744; + + bool collate_match = 423582829; + +} diff --git a/server/src/main/proto/server/search/terms_query.proto b/server/src/main/proto/server/search/terms_query.proto new file mode 100644 index 0000000000000..69ec877843d7a --- /dev/null +++ b/server/src/main/proto/server/search/terms_query.proto @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + +import "google/protobuf/wrappers.proto"; +import "server/common/common.proto"; + + +message TermsQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 1; + + .google.protobuf.StringValue name = 2; + + oneof values { + org.opensearch.common.proto.IntArray int_values = 4; + org.opensearch.common.proto.LongArray long_values = 5; + org.opensearch.common.proto.FloatArray float_values = 6; + org.opensearch.common.proto.DoubleArray double_values = 7; + org.opensearch.common.proto.StringArray string_values = 8; + org.opensearch.common.proto.BytesArray bytes_values = 9; + org.opensearch.common.proto.BoolArray bool_values = 10; + } +} diff --git a/server/src/main/proto/server/search/terms_set_query.proto b/server/src/main/proto/server/search/terms_set_query.proto new file mode 100644 index 0000000000000..1a20f9fbb54f5 --- /dev/null +++ b/server/src/main/proto/server/search/terms_set_query.proto @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + +message TermsSetQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + string minimum_should_match_field = 181511496; + + // Array of terms you wish to find in the provided field. + repeated string terms = 110250375; + +} diff --git a/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script.proto b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script.proto new file mode 100644 index 0000000000000..7e3db20396d39 --- /dev/null +++ b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script.proto @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/any.proto"; + +message TermsSetQueryAllOfMinimumShouldMatchScript { + + // Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time. + map params = 458557051; + + enum LangEnum { + LangEnum_EXPRESSION = 0; + LangEnum_JAVA = 1; + LangEnum_MUSTACHE = 2; + LangEnum_PAINLESS = 3; + } + + LangEnum lang = 3314158; + + map options = 175733092; + + // The script source. + string source = 359634918; + + string id = 3355; + +} diff --git a/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of.proto b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of.proto new file mode 100644 index 0000000000000..17f43fb18ff26 --- /dev/null +++ b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of.proto @@ -0,0 +1,46 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/any.proto"; + +message TermsSetQueryAllOfMinimumShouldMatchScriptOneOf { + + // Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time. + map params = 458557051; + + enum LangEnum { + LangEnum_EXPRESSION = 0; + LangEnum_JAVA = 1; + LangEnum_MUSTACHE = 2; + LangEnum_PAINLESS = 3; + } + + LangEnum lang = 3314158; + + map options = 175733092; + + // The script source. + string source = 359634918; + +} diff --git a/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of1.proto b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of1.proto new file mode 100644 index 0000000000000..16ab475b17bd9 --- /dev/null +++ b/server/src/main/proto/server/search/terms_set_query_all_of_minimum_should_match_script_one_of1.proto @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +import "google/protobuf/any.proto"; + +message TermsSetQueryAllOfMinimumShouldMatchScriptOneOf1 { + + // Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time. + map params = 458557051; + + string id = 3355; + +} diff --git a/server/src/main/proto/server/search/text_query_type.proto b/server/src/main/proto/server/search/text_query_type.proto new file mode 100644 index 0000000000000..559492fb353fc --- /dev/null +++ b/server/src/main/proto/server/search/text_query_type.proto @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum TextQueryType { + TextQueryType_BEST_FIELDS = 0; + TextQueryType_BOOL_PREFIX = 1; + TextQueryType_CROSS_FIELDS = 2; + TextQueryType_MOST_FIELDS = 3; + TextQueryType_PHRASE = 4; + TextQueryType_PHRASE_PREFIX = 5; +} diff --git a/server/src/main/proto/server/search/total_hits_relation.proto b/server/src/main/proto/server/search/total_hits_relation.proto new file mode 100644 index 0000000000000..b4b2e81ba811b --- /dev/null +++ b/server/src/main/proto/server/search/total_hits_relation.proto @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* + Schemas of _core.search category + + Schemas of _core.search category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum TotalHitsRelation { + TotalHitsRelation_EQ = 0; + TotalHitsRelation_GTE = 1; +} diff --git a/server/src/main/proto/server/search/wildcard_query.proto b/server/src/main/proto/server/search/wildcard_query.proto new file mode 100644 index 0000000000000..3448bc19934dd --- /dev/null +++ b/server/src/main/proto/server/search/wildcard_query.proto @@ -0,0 +1,46 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + +import "google/protobuf/wrappers.proto"; + + +message WildcardQuery { + + // Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score. + .google.protobuf.FloatValue boost = 93922211; + + .google.protobuf.StringValue name = 91108202; + + // Allows case insensitive matching of the pattern with the indexed field values when set to `true`. Default is `false` which means the case sensitivity of matching depends on the underlying field's mapping. + bool case_insensitive = 136000383; + + string rewrite = 27406734; + + // Wildcard pattern for terms you wish to find in the provided field. Required, when wildcard is not set. + string value = 111972721; + + // Wildcard pattern for terms you wish to find in the provided field. Required, when value is not set. + string wildcard = 99273256; + +} diff --git a/server/src/main/proto/server/search/zero_terms_query.proto b/server/src/main/proto/server/search/zero_terms_query.proto new file mode 100644 index 0000000000000..8773305a075de --- /dev/null +++ b/server/src/main/proto/server/search/zero_terms_query.proto @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* + Schemas of _common.query_dsl category + + Schemas of _common.query_dsl category + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.opensearch.search.proto; +option java_multiple_files = true; + + + +enum ZeroTermsQuery { + ZeroTermsQuery_ALL = 0; + ZeroTermsQuery_NONE = 1; +}