diff options
author | Stefan Felkel <stefan.felkel@besi.com> | 2019-06-25 06:00:47 (GMT) |
---|---|---|
committer | Stefan Felkel <stefan.felkel@besi.com> | 2019-06-25 06:00:47 (GMT) |
commit | 6217e3026d29a6f54e0138452706caa1bbc86307 (patch) | |
tree | 51891d962c4d7cdd75bd766318e2fb24f8dee197 /addon | |
parent | 1fae484ad6abf53cfb3364df173db3522c3e0e29 (diff) | |
download | Doxygen-6217e3026d29a6f54e0138452706caa1bbc86307.zip Doxygen-6217e3026d29a6f54e0138452706caa1bbc86307.tar.gz Doxygen-6217e3026d29a6f54e0138452706caa1bbc86307.tar.bz2 |
doxysearch: added wildcard, partial and phrase sesarch
Diffstat (limited to 'addon')
-rw-r--r-- | addon/doxysearch/doxysearch.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/addon/doxysearch/doxysearch.cpp b/addon/doxysearch/doxysearch.cpp index 1c4effd..ac5740b 100644 --- a/addon/doxysearch/doxysearch.cpp +++ b/addon/doxysearch/doxysearch.cpp @@ -367,12 +367,20 @@ 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; + parser.set_max_expansion(max_expansion,Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT); + 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 |