How QtClucene work?
-
Dear all,
I would like to know this library file QtClucene & how it works.
Is it related with lucence search like in java?
How can I implement this library?
Thanks
-
Qt uses clucene for searching in the help documents. As far as I know clucene is a C port of the Java lucene. Unfortunately there is no documentation around, but you may want to have a look at the documentation and help modules' sources in the Qt source tree.
-
There is no Qt-like interface for using QtLucene (=CLucene) in your app.
What a pity!!!You have to compile+link the sources in your app and use CLucene API, like:
int iFlags = lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_TOKENIZED;
lucene::document::Document doc;
doc.add(*(_CLNEW lucene::document::Field(tFieldName, tFieldVal, iFlags)));
writer.addDocument(&doc);search:
lucene::analysis::WhitespaceAnalyzer analyzer;
m_pQuery = lucene::queryParser::QueryParser::parse(a,_T("text"),&analyzer);
lucene::search::IndexSearcher searcher(sDirOfIndex);
m_pHits = searcher.search(m_pQuery);