diff options
Diffstat (limited to 'proto')
-rw-r--r-- | proto/icing/proto/scoring.proto | 34 | ||||
-rw-r--r-- | proto/icing/proto/search.proto | 15 |
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 |