aboutsummaryrefslogtreecommitdiff
path: root/icing/index/index.h
diff options
context:
space:
mode:
Diffstat (limited to 'icing/index/index.h')
-rw-r--r--icing/index/index.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/icing/index/index.h b/icing/index/index.h
index a5d75c4..a09e28f 100644
--- a/icing/index/index.h
+++ b/icing/index/index.h
@@ -35,6 +35,7 @@
#include "icing/index/term-metadata.h"
#include "icing/legacy/index/icing-filesystem.h"
#include "icing/proto/debug.pb.h"
+#include "icing/proto/logging.pb.h"
#include "icing/proto/scoring.pb.h"
#include "icing/proto/storage.pb.h"
#include "icing/proto/term.pb.h"
@@ -72,20 +73,16 @@ class Index {
struct Options {
explicit Options(const std::string& base_dir, uint32_t index_merge_size,
bool lite_index_sort_at_indexing,
- uint32_t lite_index_sort_size,
- bool include_property_existence_metadata_hits = false)
+ uint32_t lite_index_sort_size)
: base_dir(base_dir),
index_merge_size(index_merge_size),
lite_index_sort_at_indexing(lite_index_sort_at_indexing),
- lite_index_sort_size(lite_index_sort_size),
- include_property_existence_metadata_hits(
- include_property_existence_metadata_hits) {}
+ lite_index_sort_size(lite_index_sort_size) {}
std::string base_dir;
int32_t index_merge_size;
bool lite_index_sort_at_indexing;
int32_t lite_index_sort_size;
- bool include_property_existence_metadata_hits;
};
// Creates an instance of Index in the directory pointed by file_dir.
@@ -178,6 +175,13 @@ class Index {
return debug_info;
}
+ void PublishQueryStats(QueryStatsProto* query_stats) const {
+ query_stats->set_lite_index_hit_buffer_byte_size(
+ lite_index_->GetHitBufferByteSize());
+ query_stats->set_lite_index_hit_buffer_unsorted_byte_size(
+ lite_index_->GetHitBufferUnsortedByteSize());
+ }
+
// Returns the byte size of the all the elements held in the index. This
// excludes the size of any internal metadata of the index, e.g. the index's
// header.
@@ -301,9 +305,7 @@ class Index {
}
// Sorts the LiteIndex HitBuffer.
- void SortLiteIndex() {
- lite_index_->SortHits();
- }
+ void SortLiteIndex() { lite_index_->SortHits(); }
// Reduces internal file sizes by reclaiming space of deleted documents.
// new_last_added_document_id will be used to update the last added document