diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:55:23 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:55:23 +0900 |
commit | 1ec16d649a01d369eecae2f1225c0ffa1caaf640 (patch) | |
tree | ed6cfed60d2438db244a7cddec6d4f0cf5fa93f6 /addon/doxysearch | |
parent | 5e552810bc3dfc820036b4b16ae53561bb7cf3c6 (diff) | |
download | doxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.tar.gz doxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.tar.bz2 doxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.zip |
Imported Upstream version 1.8.16upstream/1.8.16
Diffstat (limited to 'addon/doxysearch')
-rw-r--r-- | addon/doxysearch/doxysearch.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/addon/doxysearch/doxysearch.cpp b/addon/doxysearch/doxysearch.cpp index 1c4effd..98adab4 100644 --- a/addon/doxysearch/doxysearch.cpp +++ b/addon/doxysearch/doxysearch.cpp @@ -367,12 +367,24 @@ int main(int argc,char **argv) // create query Xapian::Database db(indexDir); Xapian::Enquire enquire(db); - Xapian::Query query; + std::vector<std::string> words = split(searchFor,' '); - for (std::vector<std::string>::const_iterator it=words.begin();it!=words.end();++it) - { - query = Xapian::Query(Xapian::Query::OP_OR,query,Xapian::Query(*it)); - } + Xapian::QueryParser parser; + parser.set_database(db); + parser.set_default_op(Xapian::Query::OP_AND); + parser.set_stemming_strategy(Xapian::QueryParser::STEM_ALL); + Xapian::termcount max_expansion=100; +#if (XAPIAN_MAJOR_VERSION==1) && (XAPIAN_MINOR_VERSION==2) + parser.set_max_wildcard_expansion(max_expansion); +#else + parser.set_max_expansion(max_expansion,Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT); +#endif + Xapian::Query query=parser.parse_query(searchFor, + Xapian::QueryParser::FLAG_DEFAULT | + Xapian::QueryParser::FLAG_WILDCARD | + Xapian::QueryParser::FLAG_PHRASE | + Xapian::QueryParser::FLAG_PARTIAL + ); enquire.set_query(query); // get results |