aboutsummaryrefslogtreecommitdiff
path: root/icing/index/iterator/doc-hit-info-iterator-filter_test.cc
diff options
context:
space:
mode:
authorJiayu Hu <hujiayu@google.com>2023-04-19 12:31:23 -0700
committerJiayu Hu <hujiayu@google.com>2023-04-19 12:33:32 -0700
commita7d57e98ea7168d66cf01ace85598e33d5e9e5db (patch)
tree6685971fd4a027f52d674ee646a79ab41d4ce24f /icing/index/iterator/doc-hit-info-iterator-filter_test.cc
parentb59049b030cc330b6c8ae1d03ea4c1a34235ac9b (diff)
downloadicing-a7d57e98ea7168d66cf01ace85598e33d5e9e5db.tar.gz
Update Icing from upstream.
Descriptions: ======================================================================== Adds join info to QueryStatsProto ======================================================================== [Join][cleanup][1/x] Add Icing benchmark for qualified id join ======================================================================== [NumericSearch][benchmark][2/x] Modify run-benchmarks.py to onboard numeric search benchmark ======================================================================== [NumericSearch][benchmark][1/x] Add numeric search icing search engine benchmark ======================================================================== Switch Iterator access type used in SnippetRetriever back to kForwardIterator. ======================================================================== Fix `DocumentStore::OptimizeInto` by passing `options_.document_store_namespace_id_fingerprint()` ======================================================================== Add file size check when initializing mmap for existing metadata file. ======================================================================== Add compression level option to Icing and propagate down to PortableFileBackedProtoLog ======================================================================== Add portable_equals_proto namespace for EqualsProto in tokenized-document_test. ======================================================================== Refactor schema to check consistency of polymorphism by dependency map ======================================================================== Support the `this.propertyWeights()` function in advanced scoring ======================================================================== Randomly set optimize_rebuild_index_threshold in monkey test ======================================================================== Change benchmark batch query latency to average ======================================================================== Performance improvements to SnippetRetriever. ======================================================================== Bug: 270102295 Bug: 260625837 Bug: 269295094 Bug: 193244409 Bug: 269513147 Bug: 276345448 Bug: 259744228 Bug: 272145329 Bug: 276349029 Change-Id: Ief1cb2c21f67aac420d6b79d9b946bbecdc39a5c
Diffstat (limited to 'icing/index/iterator/doc-hit-info-iterator-filter_test.cc')
-rw-r--r--icing/index/iterator/doc-hit-info-iterator-filter_test.cc51
1 files changed, 31 insertions, 20 deletions
diff --git a/icing/index/iterator/doc-hit-info-iterator-filter_test.cc b/icing/index/iterator/doc-hit-info-iterator-filter_test.cc
index ddb216a..0900e1f 100644
--- a/icing/index/iterator/doc-hit-info-iterator-filter_test.cc
+++ b/icing/index/iterator/doc-hit-info-iterator-filter_test.cc
@@ -48,6 +48,17 @@ using ::testing::ElementsAre;
using ::testing::Eq;
using ::testing::IsEmpty;
+libtextclassifier3::StatusOr<DocumentStore::CreateResult> CreateDocumentStore(
+ const Filesystem* filesystem, const std::string& base_dir,
+ const Clock* clock, const SchemaStore* schema_store) {
+ return DocumentStore::Create(
+ filesystem, base_dir, clock, schema_store,
+ /*force_recovery_and_revalidate_documents=*/false,
+ /*namespace_id_fingerprint=*/false,
+ PortableFileBackedProtoLog<DocumentWrapper>::kDeflateCompressionLevel,
+ /*initialize_stats=*/nullptr);
+}
+
class DocHitInfoIteratorDeletedFilterTest : public ::testing::Test {
protected:
DocHitInfoIteratorDeletedFilterTest()
@@ -73,8 +84,8 @@ class DocHitInfoIteratorDeletedFilterTest : public ::testing::Test {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
document_store_ = std::move(create_result.document_store);
}
@@ -240,8 +251,8 @@ class DocHitInfoIteratorNamespaceFilterTest : public ::testing::Test {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
document_store_ = std::move(create_result.document_store);
}
@@ -395,8 +406,8 @@ class DocHitInfoIteratorSchemaTypeFilterTest : public ::testing::Test {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
document_store_ = std::move(create_result.document_store);
}
@@ -535,8 +546,8 @@ class DocHitInfoIteratorExpirationFilterTest : public ::testing::Test {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
document_store_ = std::move(create_result.document_store);
}
@@ -563,8 +574,8 @@ TEST_F(DocHitInfoIteratorExpirationFilterTest, TtlZeroIsntFilteredOut) {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
std::unique_ptr<DocumentStore> document_store =
std::move(create_result.document_store);
@@ -595,8 +606,8 @@ TEST_F(DocHitInfoIteratorExpirationFilterTest, BeforeTtlNotFilteredOut) {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
std::unique_ptr<DocumentStore> document_store =
std::move(create_result.document_store);
@@ -627,8 +638,8 @@ TEST_F(DocHitInfoIteratorExpirationFilterTest, EqualTtlFilteredOut) {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
std::unique_ptr<DocumentStore> document_store =
std::move(create_result.document_store);
@@ -660,8 +671,8 @@ TEST_F(DocHitInfoIteratorExpirationFilterTest, PastTtlFilteredOut) {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
std::unique_ptr<DocumentStore> document_store =
std::move(create_result.document_store);
@@ -735,8 +746,8 @@ class DocHitInfoIteratorFilterTest : public ::testing::Test {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
document_store_ = std::move(create_result.document_store);
}
@@ -770,8 +781,8 @@ TEST_F(DocHitInfoIteratorFilterTest, CombineAllFiltersOk) {
ICING_ASSERT_OK_AND_ASSIGN(
DocumentStore::CreateResult create_result,
- DocumentStore::Create(&filesystem_, test_dir_, &fake_clock_,
- schema_store_.get()));
+ CreateDocumentStore(&filesystem_, test_dir_, &fake_clock_,
+ schema_store_.get()));
std::unique_ptr<DocumentStore> document_store =
std::move(create_result.document_store);