261 QHelpEngineCore object that needs to be passed to the search engines constructor. |
261 QHelpEngineCore object that needs to be passed to the search engines constructor. |
262 This is required as the search engine needs to be connected to the help |
262 This is required as the search engine needs to be connected to the help |
263 engines setupFinished() signal to know when it can start to index documentation. |
263 engines setupFinished() signal to know when it can start to index documentation. |
264 |
264 |
265 After starting the indexing process the signal indexingStarted() is emitted and |
265 After starting the indexing process the signal indexingStarted() is emitted and |
266 on the end of the indexing process the indexingFinished() is emited. To stop |
266 on the end of the indexing process the indexingFinished() is emitted. To stop |
267 the indexing one can call cancelIndexing(). |
267 the indexing one can call cancelIndexing(). |
268 |
268 |
269 While the indexing process has finished, the search engine can now be used to search |
269 While the indexing process has finished, the search engine can now be used to search |
270 thru its index for a given term. To do this one may use the possibility of creating the |
270 thru its index for a given term. To do this one may use the possibility of creating the |
271 QHelpSearchQuery list by self or reuse the QHelpSearchQueryWidget which has the inbuild |
271 QHelpSearchQuery list by self or reuse the QHelpSearchQueryWidget which has the inbuild |
272 functionality to set up a proper search querys list that get's passed to the search engines |
272 functionality to set up a proper search queries list that get's passed to the search engines |
273 search() function. |
273 search() function. |
274 |
274 |
275 After the list of querys has been passed to the search engine, the signal searchingStarted() |
275 After the list of querys has been passed to the search engine, the signal searchingStarted() |
276 is emited and after the search has finished the searchingFinished() signal is emited. The |
276 is emitted and after the search has finished the searchingFinished() signal is emitted. The |
277 search process can be stopped by calling cancelSearching(). |
277 search process can be stopped by calling cancelSearching(). |
278 |
278 |
279 If the search succeeds, the searchingFinished() will be called with the search hits count, |
279 If the search succeeds, the searchingFinished() will be called with the search hits count, |
280 which can be reused to fetch the search hits from the search engine. Calling the hits() |
280 which can be reused to fetch the search hits from the search engine. Calling the hits() |
281 function with the range of hits you would like to get will return a list of the requested |
281 function with the range of hits you would like to get will return a list of the requested |
316 /*! |
316 /*! |
317 Constructs a new search engine with the given \a parent. The search engine |
317 Constructs a new search engine with the given \a parent. The search engine |
318 uses the given \a helpEngine to access the documentation that needs to be indexed. |
318 uses the given \a helpEngine to access the documentation that needs to be indexed. |
319 The QHelpEngine's setupFinished() signal is automatically connected to the |
319 The QHelpEngine's setupFinished() signal is automatically connected to the |
320 QHelpSearchEngine's indexing function, so that new documentation will be indexed |
320 QHelpSearchEngine's indexing function, so that new documentation will be indexed |
321 after the signal is emited. |
321 after the signal is emitted. |
322 */ |
322 */ |
323 QHelpSearchEngine::QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent) |
323 QHelpSearchEngine::QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent) |
324 : QObject(parent) |
324 : QObject(parent) |
325 { |
325 { |
326 d = new QHelpSearchEnginePrivate(helpEngine); |
326 d = new QHelpSearchEnginePrivate(helpEngine); |
432 { |
432 { |
433 d->cancelSearching(); |
433 d->cancelSearching(); |
434 } |
434 } |
435 |
435 |
436 /*! |
436 /*! |
437 Starts the search process using the given list of querys \a queryList |
437 Starts the search process using the given list of queries \a queryList |
438 build by the search field name and the values to search for. |
438 build by the search field name and the values to search for. |
439 */ |
439 */ |
440 void QHelpSearchEngine::search(const QList<QHelpSearchQuery> &queryList) |
440 void QHelpSearchEngine::search(const QList<QHelpSearchQuery> &queryList) |
441 { |
441 { |
442 d->search(queryList); |
442 d->search(queryList); |