From 90dd1cb3f0981883ff3f40847c3120c61f996710 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 25 Sep 2024 16:12:37 +0400 Subject: [PATCH] Enhanced test book descriptions with xapian keywords Added to test book descriptions words that serve as keywords for query syntax with boolean operators (or, and, not, xor, near, adj) enabled. Note that the change in indexed text has lead to the change in the order of returned results. --- test/data/library.xml | 6 +++--- test/library_server.cpp | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/data/library.xml b/test/data/library.xml index 1c1fe488..8508b97f 100644 --- a/test/data/library.xml +++ b/test/data/library.xml @@ -4,7 +4,7 @@ path="./zimfile_raycharles.zim" url="https://github.com/kiwix/libkiwix/raw/master/test/data/zimfile_raycharles.zim" title="Ray Charles" - description="Wikipedia articles about Ray Charles" + description="Wikipedia articles about Ray Charles (not all of them but near to what an average newborn may find more than enough)" language="eng" creator="Wikipedia" publisher="Kiwix" @@ -22,7 +22,7 @@ path="./zimfile_raycharles_uncategorized.zim" url="https://github.com/kiwix/libkiwix/raw/master/test/data/zimfile_raycharles_uncategorized.zim" title="Ray (uncategorized) Charles" - description="No category is assigned to this library entry." + description="No category is assigned to this library entry (neither adj nor xor was considered a good option)" language="rus,eng" creator="Wikipedia" publisher="Kiwix" @@ -39,7 +39,7 @@ path="./zimfile&other.zim" url="https://github.com/kiwix/libkiwix/raw/master/test/data/zimfile%26other.zim" title="Charles, Ray" - description="Wikipedia articles about Ray Charles" + description="Wikipedia articles about Ray Charles or why and when one should go to library" language="fra" creator="Wikipedia" publisher="Kiwix" diff --git a/test/library_server.cpp b/test/library_server.cpp index 2d52e5c1..aa5400c3 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -103,7 +103,7 @@ std::string maskVariableOPDSFeedData(std::string s) #define _CHARLES_RAY_CATALOG_ENTRY(CONTENT_NAME) CATALOG_ENTRY( \ "charlesray", \ "Charles, Ray", \ - "Wikipedia articles about Ray Charles", \ + "Wikipedia articles about Ray Charles or why and when one should go to library", \ "fra", \ "wikipedia_fr_ray_charles",\ "jazz",\ @@ -120,7 +120,7 @@ std::string maskVariableOPDSFeedData(std::string s) #define _RAY_CHARLES_CATALOG_ENTRY(CONTENT_NAME) CATALOG_ENTRY(\ "raycharles",\ "Ray Charles",\ - "Wikipedia articles about Ray Charles",\ + "Wikipedia articles about Ray Charles (not all of them but near to what an average newborn may find more than enough)",\ "eng",\ "wikipedia_en_ray_charles",\ "wikipedia",\ @@ -139,7 +139,7 @@ std::string maskVariableOPDSFeedData(std::string s) #define UNCATEGORIZED_RAY_CHARLES_CATALOG_ENTRY CATALOG_ENTRY(\ "raycharles_uncategorized",\ "Ray (uncategorized) Charles",\ - "No category is assigned to this library entry.",\ + "No category is assigned to this library entry (neither adj nor xor was considered a good option)",\ "rus,eng",\ "wikipedia_ru_ray_charles",\ "",\ @@ -199,8 +199,8 @@ TEST_F(LibraryServerTest, catalog_search_by_phrase) " 0\n" " 2\n" CATALOG_LINK_TAGS - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -218,8 +218,8 @@ TEST_F(LibraryServerTest, catalog_search_by_words) " 0\n" " 3\n" CATALOG_LINK_TAGS - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY UNCATEGORIZED_RAY_CHARLES_CATALOG_ENTRY "\n" ); @@ -239,8 +239,8 @@ TEST_F(LibraryServerTest, catalog_prefix_search) " 0\n" " 2\n" CATALOG_LINK_TAGS - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -275,8 +275,8 @@ TEST_F(LibraryServerTest, catalog_search_with_word_exclusion) " 0\n" " 2\n" CATALOG_LINK_TAGS - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -331,8 +331,8 @@ TEST_F(LibraryServerTest, catalog_search_by_category) " 0\n" " 2\n" CATALOG_LINK_TAGS - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -772,8 +772,8 @@ TEST_F(LibraryServerTest, catalog_v2_entries_filtered_by_search_terms) " 2\n" " 0\n" " 2\n" - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -841,8 +841,8 @@ TEST_F(LibraryServerTest, catalog_v2_entries_filtered_by_category) " 2\n" " 0\n" " 2\n" - RAY_CHARLES_CATALOG_ENTRY CHARLES_RAY_CATALOG_ENTRY + RAY_CHARLES_CATALOG_ENTRY "\n" ); } @@ -1086,7 +1086,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) "
\n" \ "
Charles, Ray
\n" \ "
\n" \ - "
Wikipedia articles about Ray Charles
\n" \ + "
Wikipedia articles about Ray Charles or why and when one should go to library
\n" \ " \n" \ " \n" \ "
\n" \ @@ -1113,7 +1113,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) "
\n" \ "
Ray Charles
\n" \ "
\n" \ - "
Wikipedia articles about Ray Charles
\n" \ + "
Wikipedia articles about Ray Charles (not all of them but near to what an average newborn may find more than enough)
\n" \ "
\n" \ " \n" \ "
\n" \ @@ -1140,7 +1140,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) "
\n" \ "
Ray (uncategorized) Charles
\n" \ "
\n" \ - "
No category is assigned to this library entry.
\n" \ + "
No category is assigned to this library entry (neither adj nor xor was considered a good option)
\n" \ "
\n" \ " \n" \ "
\n" \