fts-api.h revision 3852872e6954b7132e637294132005e86b8ebd4a
#ifndef FTS_API_H
#define FTS_API_H
struct mail;
struct mailbox;
struct fts_backend_build_context;
#include "seq-range-array.h"
enum fts_lookup_flags {
FTS_LOOKUP_FLAG_HEADER = 0x01,
FTS_LOOKUP_FLAG_BODY = 0x02,
FTS_LOOKUP_FLAG_INVERT = 0x04
};
struct fts_backend_uid_map {
const char *mailbox;
};
struct fts_score_map {
float score;
};
struct fts_backend *
/* Get the last_uid for the mailbox. */
/* Get last_uids for all mailboxes that might be backend mailboxes for a
virtual mailbox. Depending on virtual mailbox configuration, this function
may also return mailboxes that don't really even match the virtual mailbox
patterns. The caller should filter out the list itself. */
/* Initialize adding new data to the index. last_uid_r is set to the last UID
that exists in the index. */
struct fts_backend_build_context **ctx_r);
/* Add more contents to the index. The data must contain only full valid
UTF-8 characters, but it doesn't need to be NUL-terminated. size contains
the data size in bytes, not characters. headers is TRUE if the data contains
message headers instead of message body. */
bool headers);
/* Finish adding new data to the index. */
/* Returns TRUE if there exists a build context. */
/* Expunge given mail from the backend. Note that the transaction may still
fail later. */
/* Called after transaction has been committed or rollbacked. */
locking timeouted, -1 if error.
It's not required to call these functions manually, but if you're doing
/* Start building a FTS lookup. */
struct fts_backend_lookup_context *
/* Add a new search key to the lookup. */
/* Finish the lookup and return found UIDs. */
#endif