summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6b228e4)
This name is a more accurate description of what it does, and
the more general naming will make sense as we start storing
non-message documents in the database (such as directory
timestamps).
Also, don't pass around a Xapian::Database where it's more our
style to pass a notmuch_database_t*.
-find_messages_by_term (Xapian::Database *db,
- const char *prefix_name,
- const char *value,
- Xapian::PostingIterator *begin,
- Xapian::PostingIterator *end)
+find_doc_ids (notmuch_database_t *notmuch,
+ const char *prefix_name,
+ const char *value,
+ Xapian::PostingIterator *begin,
+ Xapian::PostingIterator *end)
{
Xapian::PostingIterator i;
char *term;
term = g_strdup_printf ("%s%s", _find_prefix (prefix_name), value);
{
Xapian::PostingIterator i;
char *term;
term = g_strdup_printf ("%s%s", _find_prefix (prefix_name), value);
- *begin = db->postlist_begin (term);
+ *begin = notmuch->xapian_db->postlist_begin (term);
- if (end)
- *end = db->postlist_end (term);
+ *end = notmuch->xapian_db->postlist_end (term);
{
Xapian::PostingIterator i, end;
{
Xapian::PostingIterator i, end;
- find_messages_by_term (notmuch->xapian_db,
- "msgid", message_id, &i, &end);
+ find_doc_ids (notmuch, "msgid", message_id, &i, &end);
if (i == end)
return NULL;
if (i == end)
return NULL;
thread_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
free, NULL);
thread_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
free, NULL);
- find_messages_by_term (db, "ref", message_id, &child, &children_end);
+ find_doc_ids (notmuch, "ref", message_id, &child, &children_end);
for ( ; child != children_end; child++) {
doc = find_message_by_docid (db, *child);
insert_thread_id (thread_ids, doc);
for ( ; child != children_end; child++) {
doc = find_message_by_docid (db, *child);
insert_thread_id (thread_ids, doc);