diff options
author | Tim Barron <tjbarron@google.com> | 2023-03-06 17:26:23 -0800 |
---|---|---|
committer | Tim Barron <tjbarron@google.com> | 2023-03-06 17:26:23 -0800 |
commit | 53032446fec369125a6dc47c9f66435e4a62410b (patch) | |
tree | 779ba434530b8af387bc1e2f9f37aca52e298b1d /icing/index/index-processor.cc | |
parent | 49064c458678781fbf3db256751658728dc87740 (diff) | |
download | icing-53032446fec369125a6dc47c9f66435e4a62410b.tar.gz |
Update Icing from upstream.
Descriptions:
======================================================================
Refactor IndexProcessor
======================================================================
Rename Joinable Cache as Joinable Index
======================================================================
Implement Optimize and Clear for QualifiedIdTypeJoinableCache
======================================================================
Add JoinablePropertyMetadata reverse lookup
======================================================================
Allow code creating LanguageSegmenter::Iterators to declare AccessType
======================================================================
Further codifies the escape behavior in the parser test
======================================================================
Bug: 263890397
Bug: 268680462
Bug: 270102295
Change-Id: I3233733b40e985e11c4a6d75c1528cd6a72c1173
Diffstat (limited to 'icing/index/index-processor.cc')
-rw-r--r-- | icing/index/index-processor.cc | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/icing/index/index-processor.cc b/icing/index/index-processor.cc index 86a0826..34988f5 100644 --- a/icing/index/index-processor.cc +++ b/icing/index/index-processor.cc @@ -21,44 +21,21 @@ #include <vector> #include "icing/text_classifier/lib3/utils/base/status.h" -#include "icing/index/index.h" -#include "icing/index/integer-section-indexing-handler.h" -#include "icing/index/numeric/numeric-index.h" -#include "icing/index/string-section-indexing-handler.h" +#include "icing/index/data-indexing-handler.h" #include "icing/proto/logging.pb.h" #include "icing/store/document-id.h" -#include "icing/transform/normalizer.h" #include "icing/util/status-macros.h" #include "icing/util/tokenized-document.h" namespace icing { namespace lib { -libtextclassifier3::StatusOr<std::unique_ptr<IndexProcessor>> -IndexProcessor::Create(const Normalizer* normalizer, Index* index, - NumericIndex<int64_t>* integer_index, const Clock* clock, - bool recovery_mode) { - ICING_RETURN_ERROR_IF_NULL(normalizer); - ICING_RETURN_ERROR_IF_NULL(index); - ICING_RETURN_ERROR_IF_NULL(integer_index); - ICING_RETURN_ERROR_IF_NULL(clock); - - std::vector<std::unique_ptr<SectionIndexingHandler>> handlers; - handlers.push_back( - std::make_unique<StringSectionIndexingHandler>(clock, normalizer, index)); - handlers.push_back( - std::make_unique<IntegerSectionIndexingHandler>(clock, integer_index)); - - return std::unique_ptr<IndexProcessor>( - new IndexProcessor(std::move(handlers), clock, recovery_mode)); -} - libtextclassifier3::Status IndexProcessor::IndexDocument( const TokenizedDocument& tokenized_document, DocumentId document_id, PutDocumentStatsProto* put_document_stats) { // TODO(b/259744228): set overall index latency. - for (auto& section_indexing_handler : section_indexing_handlers_) { - ICING_RETURN_IF_ERROR(section_indexing_handler->Handle( + for (auto& data_indexing_handler : data_indexing_handlers_) { + ICING_RETURN_IF_ERROR(data_indexing_handler->Handle( tokenized_document, document_id, recovery_mode_, put_document_stats)); } |