Class Searcher

Class Documentation

class Searcher

A Searcher is a object fulltext searching a set of Archives

A Searcher is mainly used to create new Search Internaly, this is mainly a wrapper around a Xapian database.

You should consider that all search operations are NOT threadsafe. It is up to you to protect your calls to avoid race competition. However, Searcher (and subsequent classes) do not maintain a global/share state. You can create several Searchers and use them in different threads.

Public Functions

explicit Searcher(const std::vector<Archive> &archives)

Searcher constructor.

Construct a searcher on top of several archives (multi search).

Parameters:

archives – A list(vector) of archives to search on.

explicit Searcher(const Archive &archive)

Searcher constructor.

Construct a searcher on top of on archive.

Parameters:

archive – A archive to search on.

Searcher(const Searcher &other)
Searcher &operator=(const Searcher &other)
Searcher(Searcher &&other)
Searcher &operator=(Searcher &&other)
~Searcher()
Searcher &addArchive(const Archive &archive)

Add a archive to the searcher.

Adding a archive to a searcher do not invalidate already created search.

Search search(const Query &query)

Create a search for a specific query.

The search is made on all archives added to the Searcher.

Parameters:

query – The Query to search.

Throws:

std::runtime_error – if the searcher does not have a valid FT database.

void setVerbose(bool verbose)

Set the verbosity of search operations.

Parameters:

verbose – The verbose mode to set