aboutsummaryrefslogtreecommitdiff
path: root/icing/index/index-processor.h
diff options
context:
space:
mode:
authorTim Barron <tjbarron@google.com>2021-09-13 16:50:12 -0700
committerTim Barron <tjbarron@google.com>2021-09-13 16:50:12 -0700
commit8d15dee359511993779f4b82a5a830dbf36ec1a5 (patch)
tree8f9bb479d0936594c5e9418dd3cbbb998cf5d4c1 /icing/index/index-processor.h
parentf697841f2e2cb577cedc0a5c5b31241902fb81ce (diff)
downloadicing-8d15dee359511993779f4b82a5a830dbf36ec1a5.tar.gz
Sync from upstream.
Descriptions: ================ Implement ranking in FindTermByPrefix. ================ Fork proto's GzipStream into Icing Lib. ================ Remove token limit behavior from index-processor. ================ Bug: 152934343 Bug: 147509515 Bug: 196771754 Change-Id: I7f95392afc97001df0ae3f60720743c74d64ba84
Diffstat (limited to 'icing/index/index-processor.h')
-rw-r--r--icing/index/index-processor.h29
1 files changed, 3 insertions, 26 deletions
diff --git a/icing/index/index-processor.h b/icing/index/index-processor.h
index 6b07c98..c4b77b5 100644
--- a/icing/index/index-processor.h
+++ b/icing/index/index-processor.h
@@ -32,23 +32,6 @@ namespace lib {
class IndexProcessor {
public:
- struct Options {
- int32_t max_tokens_per_document;
-
- // Indicates how a document exceeding max_tokens_per_document should be
- // handled.
- enum class TokenLimitBehavior {
- // When set, the first max_tokens_per_document will be indexed. If the
- // token count exceeds max_tokens_per_document, a ResourceExhausted error
- // will be returned.
- kReturnError,
- // When set, the first max_tokens_per_document will be indexed. If the
- // token count exceeds max_tokens_per_document, OK will be returned.
- kSuppressError,
- };
- TokenLimitBehavior token_limit_behavior;
- };
-
// Factory function to create an IndexProcessor which does not take ownership
// of any input components, and all pointers must refer to valid objects that
// outlive the created IndexProcessor instance.
@@ -57,8 +40,7 @@ class IndexProcessor {
// An IndexProcessor on success
// FAILED_PRECONDITION if any of the pointers is null.
static libtextclassifier3::StatusOr<std::unique_ptr<IndexProcessor>> Create(
- const Normalizer* normalizer, Index* index, const Options& options,
- const Clock* clock);
+ const Normalizer* normalizer, Index* index, const Clock* clock);
// Add tokenized document to the index, associated with document_id. If the
// number of tokens in the document exceeds max_tokens_per_document, then only
@@ -84,18 +66,13 @@ class IndexProcessor {
PutDocumentStatsProto* put_document_stats = nullptr);
private:
- IndexProcessor(const Normalizer* normalizer, Index* index,
- const Options& options, const Clock* clock)
- : normalizer_(*normalizer),
- index_(index),
- options_(options),
- clock_(*clock) {}
+ IndexProcessor(const Normalizer* normalizer, Index* index, const Clock* clock)
+ : normalizer_(*normalizer), index_(index), clock_(*clock) {}
std::string NormalizeToken(const Token& token);
const Normalizer& normalizer_;
Index* const index_;
- const Options options_;
const Clock& clock_;
};