]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
lib: Explicitly set BoolWeight when searching.
authorCarl Worth <cworth@cworth.org>
Sat, 9 Jan 2010 19:16:40 +0000 (11:16 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 9 Jan 2010 19:16:40 +0000 (11:16 -0800)
All notmuch searches currently sort by value (either date or message
ID) so it's just wasted effort for Xapian to compute relevance values
for each result. We now explicitly tell Xapian that we're uninterested
in the relevance values.

lib/query.cc

index 9106b92deeccfe7a646091c5e8cc35bc660569ed..2c8d167255bb903a5224d6d5b7ba0408e108bd00 100644 (file)
@@ -134,6 +134,8 @@ notmuch_query_search_messages (notmuch_query_t *query)
                                         mail_query, string_query);
        }
 
                                         mail_query, string_query);
        }
 
+       enquire.set_weighting_scheme (Xapian::BoolWeight());
+
        switch (query->sort) {
        case NOTMUCH_SORT_OLDEST_FIRST:
            enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, FALSE);
        switch (query->sort) {
        case NOTMUCH_SORT_OLDEST_FIRST:
            enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, FALSE);