From 1e9a26893cdfe5f92a833d03a75d970baab2d8b2 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 16 Nov 2021 10:52:18 +0100 Subject: [PATCH] Forum deep search support wildcard* search Xapian have support for wildcard search wild* matches wild, wildcard, wildcat, wilderness but it need to be enabled by passing a specific flag to the query parser, this is very useful for forum search so enable it in addition to default Xapian search capabilities --- libretroshare/src/deep_search/forumsindex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/deep_search/forumsindex.cpp b/libretroshare/src/deep_search/forumsindex.cpp index acc7aed9a..a04f2ecac 100644 --- a/libretroshare/src/deep_search/forumsindex.cpp +++ b/libretroshare/src/deep_search/forumsindex.cpp @@ -46,7 +46,9 @@ std::error_condition DeepForumsIndex::search( // End of prefix configuration. // And parse the query. - Xapian::Query query = queryparser.parse_query(queryStr); + using XQP = Xapian::QueryParser; + Xapian::Query query = queryparser.parse_query( + queryStr, XQP::FLAG_WILDCARD | XQP::FLAG_DEFAULT ); // Use an Enquire object on the database to run the query. Xapian::Enquire enquire(db);