aboutsummaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorTerry Wang <tytytyww@google.com>2022-10-11 12:56:19 -0700
committerTerry Wang <tytytyww@google.com>2022-10-11 20:57:28 +0000
commite07f3e265f864ad9c97ee0dcec6d4809a05e95fa (patch)
tree55e181e6e9e0b84178242b01180d9bd91c298728 /proto
parenta570eb457c8cf5d677a2616aff0b7a7dcf72e665 (diff)
downloadicing-e07f3e265f864ad9c97ee0dcec6d4809a05e95fa.tar.gz
Update Icing from upstream.
Descriptions: ====================================================================== Implement URL tokenization for Icing-lib ====================================================================== Adds RFC822_HOST_ADDRESS ====================================================================== Support Suggestion API could be ordered by term's frequency. ====================================================================== Bug: 246964044 Bug: 230553264 Change-Id: Id7e7b1e080bb66ccf03452e75b72c5cceed2f7db
Diffstat (limited to 'proto')
-rw-r--r--proto/icing/proto/scoring.proto34
-rw-r--r--proto/icing/proto/search.proto15
2 files changed, 35 insertions, 14 deletions
diff --git a/proto/icing/proto/scoring.proto b/proto/icing/proto/scoring.proto
index 71c943e..375e9bd 100644
--- a/proto/icing/proto/scoring.proto
+++ b/proto/icing/proto/scoring.proto
@@ -16,6 +16,8 @@ syntax = "proto2";
package icing.lib;
+import "icing/proto/term.proto";
+
option java_package = "com.google.android.icing.proto";
option java_multiple_files = true;
option objc_class_prefix = "ICNG";
@@ -97,6 +99,38 @@ message ScoringSpecProto {
}
// Next tag: 3
+message SuggestionScoringSpecProto {
+ message SuggestionRankingStrategy {
+ enum Code {
+ // No ranking strategy specified, terms may be returned in an arbitrary
+ // order.
+ NONE = 0;
+
+ // Ranked by the term's hit count.
+ DOCUMENT_COUNT = 1;
+
+ // Ranked by the term's frequency.
+ TERM_FREQUENCY = 2;
+ }
+ }
+
+ // TermMatchType.Code=UNKNOWN
+ // Should never purposely be set and may lead to undefined behavior. This is
+ // used for backwards compatibility reasons.
+ //
+ // TermMatchType.Code=EXACT_ONLY
+ // Only exact hits will be counted to score a suggestion term.
+ //
+ // TermMatchType.Code=PREFIX
+ // Both exact hits and prefix hits will be counted to score a suggestion
+ // term.
+ optional TermMatchType.Code scoring_match_type = 1;
+
+ // Rank the output suggested result by given SuggestionRankingStrategy.
+ optional SuggestionRankingStrategy.Code rank_by = 2;
+}
+
+// Next tag: 3
message TypePropertyWeights {
// Schema type to apply property weights to.
optional string schema_type = 1;
diff --git a/proto/icing/proto/search.proto b/proto/icing/proto/search.proto
index f03a482..e3324a3 100644
--- a/proto/icing/proto/search.proto
+++ b/proto/icing/proto/search.proto
@@ -18,6 +18,7 @@ package icing.lib;
import "icing/proto/document.proto";
import "icing/proto/logging.proto";
+import "icing/proto/scoring.proto";
import "icing/proto/status.proto";
import "icing/proto/term.proto";
@@ -358,20 +359,6 @@ message SuggestionSpecProto {
optional int32 num_to_return = 3;
// Indicates how the suggestion terms should be scored and ranked.
- message SuggestionScoringSpecProto {
- // TermMatchType.Code=UNKNOWN
- // Should never purposely be set and may lead to undefined behavior. This is
- // used for backwards compatibility reasons.
- //
- // TermMatchType.Code=EXACT_ONLY
- // Only exact hits will be counted to score a suggestion term.
- //
- // TermMatchType.Code=PREFIX
- // Both exact hits and prefix hits will be counted to score a suggestion
- // term.
- optional TermMatchType.Code scoring_match_type = 1;
- }
-
optional SuggestionScoringSpecProto scoring_spec = 4;
// OPTIONAL: Only search for suggestions that under the specified