diff options
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)); } |