forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move query definitions to Query.proto. Add basic term query.
Signed-off-by: Finn Carroll <[email protected]>
- Loading branch information
1 parent
609e675
commit 0c69cd2
Showing
3 changed files
with
107 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
server/src/main/proto/org/opensearch/action/search/Query.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package org.opensearch.action.search.proto; | ||
|
||
import "google/protobuf/struct.proto"; | ||
|
||
option java_multiple_files = true; | ||
option java_outer_classname = "QueryProto"; | ||
|
||
message QueryContainer { | ||
oneof query { | ||
MatchAllQuery match_all = 1; | ||
TermQuery term = 2; | ||
} | ||
} | ||
|
||
message MatchAllQuery { | ||
// Query name for query tagging | ||
optional string name = 1; | ||
// Boosts the clause by the given multiplier. Default is 1. | ||
optional float boost = 2; | ||
} | ||
|
||
message TermQuery { | ||
// Query name for query tagging | ||
optional string name = 1; | ||
// Boosts the clause by the given multiplier. Default is 1. | ||
optional float boost = 2; | ||
// Field to match on. | ||
string field = 3; | ||
// Value to match. | ||
FieldValue val = 4; | ||
message FieldValue { | ||
oneof TypedVal { | ||
string strVal = 1; | ||
int64 intVal = 2; | ||
double doubleVal = 3; | ||
bool boolVal = 4; | ||
bytes byteVal = 5; | ||
} | ||
} | ||
// Defaults to false. | ||
bool case_insensitive = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters