diff options
author | Tim Barron <tjbarron@google.com> | 2023-03-31 16:48:52 -0700 |
---|---|---|
committer | Tim Barron <tjbarron@google.com> | 2023-03-31 16:48:52 -0700 |
commit | b59049b030cc330b6c8ae1d03ea4c1a34235ac9b (patch) | |
tree | 09bb4692739de390a5ad70e5dc4f9acb7830fa3e /icing/result/result-state-v2.cc | |
parent | f3155ae11285c16d8d9de56b1ec1a1e0def2cf62 (diff) | |
download | icing-b59049b030cc330b6c8ae1d03ea4c1a34235ac9b.tar.gz |
Update Icing from upstream.
Descriptions:
========================================================================
Make int64_t the CreateUsageReport timestamp type
========================================================================
Create ResultAdjustmentInfo and refactor ResultStateV2
========================================================================
Wrap parent/child adjustment info to std::unique_ptr
========================================================================
Apply join child snippet
========================================================================
Apply join child projection
========================================================================
Add IntegerSectionIndexingHandlerTest
========================================================================
Delete Result Retriever this class is dead code.
========================================================================
Introduce a placeholder for the custom function hasPropertyDefined(member)
========================================================================
Fix libtextclassifier3::StatusOr
========================================================================
Performance improvements to SnippetRetriever.
========================================================================
Bug: 193244409
Bug: 256022027
Bug: 259744228
Bug: 268680462
Bug: 270102295
Bug: 271015984
Bug: 274627497
Change-Id: I6bad316b28bb289fa8e3f5b0982d6aaa9e0d135f
Diffstat (limited to 'icing/result/result-state-v2.cc')
-rw-r--r-- | icing/result/result-state-v2.cc | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/icing/result/result-state-v2.cc b/icing/result/result-state-v2.cc index e42620e..9459910 100644 --- a/icing/result/result-state-v2.cc +++ b/icing/result/result-state-v2.cc @@ -15,54 +15,33 @@ #include "icing/result/result-state-v2.h" #include <atomic> +#include <cstdint> #include <memory> +#include <string> +#include <vector> -#include "icing/proto/scoring.pb.h" #include "icing/proto/search.pb.h" -#include "icing/proto/term.pb.h" -#include "icing/result/projection-tree.h" -#include "icing/result/snippet-context.h" +#include "icing/result/result-adjustment-info.h" #include "icing/scoring/scored-document-hits-ranker.h" +#include "icing/store/document-store.h" namespace icing { namespace lib { -namespace { -SnippetContext CreateSnippetContext(SectionRestrictQueryTermsMap query_terms, - const SearchSpecProto& search_spec, - const ResultSpecProto& result_spec) { - if (result_spec.snippet_spec().num_to_snippet() > 0 && - result_spec.snippet_spec().num_matches_per_property() > 0) { - // Needs snippeting - return SnippetContext(std::move(query_terms), result_spec.snippet_spec(), - search_spec.term_match_type()); - } - return SnippetContext(/*query_terms_in=*/{}, - ResultSpecProto::SnippetSpecProto::default_instance(), - TermMatchType::UNKNOWN); -} -} // namespace - ResultStateV2::ResultStateV2( std::unique_ptr<ScoredDocumentHitsRanker> scored_document_hits_ranker_in, - SectionRestrictQueryTermsMap query_terms, - const SearchSpecProto& search_spec, const ScoringSpecProto& scoring_spec, + std::unique_ptr<ResultAdjustmentInfo> parent_adjustment_info, + std::unique_ptr<ResultAdjustmentInfo> child_adjustment_info, const ResultSpecProto& result_spec, const DocumentStore& document_store) : scored_document_hits_ranker(std::move(scored_document_hits_ranker_in)), num_returned(0), - snippet_context_(CreateSnippetContext(std::move(query_terms), search_spec, - result_spec)), + parent_adjustment_info_(std::move(parent_adjustment_info)), + child_adjustment_info_(std::move(child_adjustment_info)), num_per_page_(result_spec.num_per_page()), num_total_bytes_per_page_threshold_( result_spec.num_total_bytes_per_page_threshold()), num_total_hits_(nullptr), result_group_type_(result_spec.result_group_type()) { - for (const TypePropertyMask& type_field_mask : - result_spec.type_property_masks()) { - projection_tree_map_.insert( - {type_field_mask.schema_type(), ProjectionTree(type_field_mask)}); - } - for (const ResultSpecProto::ResultGrouping& result_grouping : result_spec.result_groupings()) { int group_id = group_result_limits.size(); |