Empty query acts as a match-all query

After switching to Xapian-based search in the library/catalog, an empty
query stopped acting as a match-all query. This commit restores the old
behaviour in that regard.
This commit is contained in:
Veloman Yunkan
2021-05-08 23:36:49 +04:00
committed by Emmanuel Engelhart
parent 02c3dff142
commit 41276341d0
2 changed files with 19 additions and 1 deletions

View File

@ -479,6 +479,24 @@ TEST_F(LibraryTest, filterByQuery)
}
TEST_F(LibraryTest, filteringByEmptyQueryReturnsAllEntries)
{
EXPECT_FILTER_RESULTS(kiwix::Filter().query(""),
"An example ZIM archive",
"Encyclopédie de la Tunisie",
"Granblue Fantasy Wiki",
"Géographie par Wikipédia",
"Islam Stack Exchange",
"Mathématiques",
"Movies & TV Stack Exchange",
"Mythology & Folklore Stack Exchange",
"Ray Charles",
"TED talks - Business",
"Tania Louis",
"Wikiquote"
);
}
TEST_F(LibraryTest, filterByCreator)
{
EXPECT_FILTER_RESULTS(kiwix::Filter().creator("Wikipedia"),