_notmuch_doc_id_set_init (void *ctx,
notmuch_doc_id_set_t *doc_ids,
GArray *arr);
_notmuch_doc_id_set_init (void *ctx,
notmuch_doc_id_set_t *doc_ids,
GArray *arr);
return (env && strcmp (env, "") != 0);
}
/* Explicit destructor call for placement new */
static int
return (env && strcmp (env, "") != 0);
}
/* Explicit destructor call for placement new */
static int
- /* Xapian doesn't support skip_to on terms from a query since
- * they are unordered, so cache a copy of all terms in
- * something searchable.
- */
+ /* Xapian doesn't support skip_to on terms from a query since
+ * they are unordered, so cache a copy of all terms in
+ * something searchable.
+ */
for (Xapian::TermIterator t = query->xapian_query.get_terms_begin ();
t != query->xapian_query.get_terms_end (); ++t)
query->terms.insert (*t);
for (Xapian::TermIterator t = query->xapian_query.get_terms_begin ();
t != query->xapian_query.get_terms_end (); ++t)
query->terms.insert (*t);
_notmuch_database_log (query->notmuch,
"A Xapian exception occurred parsing query: %s\n",
error.get_msg ().c_str ());
_notmuch_database_log_append (query->notmuch,
"Query string was: %s\n",
query->query_string);
_notmuch_database_log (query->notmuch,
"A Xapian exception occurred parsing query: %s\n",
error.get_msg ().c_str ());
_notmuch_database_log_append (query->notmuch,
"Query string was: %s\n",
query->query_string);
return status;
term = talloc_asprintf (query, "%s%s", _find_prefix ("tag"), tag);
return status;
term = talloc_asprintf (query, "%s%s", _find_prefix ("tag"), tag);
return NOTMUCH_STATUS_IGNORED;
_notmuch_string_list_append (query->exclude_terms, term);
return NOTMUCH_STATUS_IGNORED;
_notmuch_string_list_append (query->exclude_terms, term);
messages->base.iterator = NULL;
messages->notmuch = notmuch;
new (&messages->iterator) Xapian::MSetIterator ();
messages->base.iterator = NULL;
messages->notmuch = notmuch;
new (&messages->iterator) Xapian::MSetIterator ();
Xapian::MSetIterator iterator;
if (strcmp (query_string, "") == 0 ||
Xapian::MSetIterator iterator;
if (strcmp (query_string, "") == 0 ||
final_query = mail_query;
} else {
final_query = Xapian::Query (Xapian::Query::OP_AND,
final_query = mail_query;
} else {
final_query = Xapian::Query (Xapian::Query::OP_AND,
final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
final_query, exclude_query);
} else { /* NOTMUCH_EXCLUDE_FLAG */
exclude_query = Xapian::Query (Xapian::Query::OP_AND,
final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
final_query, exclude_query);
} else { /* NOTMUCH_EXCLUDE_FLAG */
exclude_query = Xapian::Query (Xapian::Query::OP_AND,
enquire.set_query (exclude_query);
mset = enquire.get_mset (0, notmuch->xapian_db->get_doccount ());
enquire.set_query (exclude_query);
mset = enquire.get_mset (0, notmuch->xapian_db->get_doccount ());
for (iterator = mset.begin (); iterator != mset.end (); iterator++) {
unsigned int doc_id = *iterator;
for (iterator = mset.begin (); iterator != mset.end (); iterator++) {
unsigned int doc_id = *iterator;
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch,
"A Xapian exception occurred performing query: %s\n",
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch,
"A Xapian exception occurred performing query: %s\n",
INTERNAL_ERROR ("a messages iterator contains a non-existent document ID.\n");
}
if (messages->excluded_doc_ids &&
_notmuch_doc_id_set_contains (messages->excluded_doc_ids, doc_id))
INTERNAL_ERROR ("a messages iterator contains a non-existent document ID.\n");
}
if (messages->excluded_doc_ids &&
_notmuch_doc_id_set_contains (messages->excluded_doc_ids, doc_id))
_notmuch_doc_id_set_init (void *ctx,
notmuch_doc_id_set_t *doc_ids,
GArray *arr)
_notmuch_doc_id_set_init (void *ctx,
notmuch_doc_id_set_t *doc_ids,
GArray *arr)
- max = MAX(max, g_array_index (arr, unsigned int, i));
- bitmap = talloc_zero_array (ctx, unsigned char, DOCIDSET_WORD(max) + 1);
+ max = MAX (max, g_array_index (arr, unsigned int, i));
+ bitmap = talloc_zero_array (ctx, unsigned char, DOCIDSET_WORD (max) + 1);
doc_ids->bitmap = bitmap;
doc_ids->bound = max + 1;
for (unsigned int i = 0; i < arr->len; i++) {
unsigned int doc_id = g_array_index (arr, unsigned int, i);
doc_ids->bitmap = bitmap;
doc_ids->bound = max + 1;
for (unsigned int i = 0; i < arr->len; i++) {
unsigned int doc_id = g_array_index (arr, unsigned int, i);
_notmuch_doc_id_set_contains (notmuch_doc_id_set_t *doc_ids,
unsigned int doc_id)
{
if (doc_id >= doc_ids->bound)
_notmuch_doc_id_set_contains (notmuch_doc_id_set_t *doc_ids,
unsigned int doc_id)
{
if (doc_id >= doc_ids->bound)
while (notmuch_messages_valid (messages)) {
unsigned int doc_id = _notmuch_mset_messages_get_doc_id (messages);
g_array_append_val (threads->doc_ids, doc_id);
while (notmuch_messages_valid (messages)) {
unsigned int doc_id = _notmuch_mset_messages_get_doc_id (messages);
g_array_append_val (threads->doc_ids, doc_id);
while (threads->doc_id_pos < threads->doc_ids->len) {
doc_id = g_array_index (threads->doc_ids, unsigned int,
while (threads->doc_id_pos < threads->doc_ids->len) {
doc_id = g_array_index (threads->doc_ids, unsigned int,
final_query = mail_query;
} else {
final_query = Xapian::Query (Xapian::Query::OP_AND,
final_query = mail_query;
} else {
final_query = Xapian::Query (Xapian::Query::OP_AND,
exclude_query = _notmuch_exclude_tags (query);
final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
exclude_query = _notmuch_exclude_tags (query);
final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
- enquire.set_weighting_scheme(Xapian::BoolWeight());
- enquire.set_docid_order(Xapian::Enquire::ASCENDING);
+ enquire.set_weighting_scheme (Xapian::BoolWeight ());
+ enquire.set_docid_order (Xapian::Enquire::ASCENDING);
/*
* Set the checkatleast parameter to the number of documents
* in the database to make get_matches_estimated() exact.
/*
* Set the checkatleast parameter to the number of documents
* in the database to make get_matches_estimated() exact.
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch,
"A Xapian exception occurred performing query: %s\n",
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch,
"A Xapian exception occurred performing query: %s\n",
_notmuch_database_log_append (notmuch,
"Query string was: %s\n",
query->query_string);
_notmuch_database_log_append (notmuch,
"Query string was: %s\n",
query->query_string);