aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/message.cc9
-rwxr-xr-xtest/T080-search.sh2
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/message.cc b/lib/message.cc
index 9243b769..d0b7351e 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1023,16 +1023,21 @@ _notmuch_message_gen_terms (notmuch_message_t *message,
return NOTMUCH_PRIVATE_STATUS_NULL_POINTER;
term_gen->set_document (message->doc);
- term_gen->set_termpos (message->termpos);
if (prefix_name) {
const char *prefix = _find_prefix (prefix_name);
+ term_gen->set_termpos (message->termpos);
term_gen->index_text (text, 1, prefix);
- message->termpos = term_gen->get_termpos ();
+ /* Create a gap between this an the next terms so they don't
+ * appear to be a phrase. */
+ message->termpos = term_gen->get_termpos () + 100;
}
+ term_gen->set_termpos (message->termpos);
term_gen->index_text (text);
+ /* Create a term gap, as above. */
+ message->termpos = term_gen->get_termpos () + 100;
return NOTMUCH_PRIVATE_STATUS_SUCCESS;
}
diff --git a/test/T080-search.sh b/test/T080-search.sh
index 3f6b565f..05027fb0 100755
--- a/test/T080-search.sh
+++ b/test/T080-search.sh
@@ -170,14 +170,12 @@ EOF
notmuch new > /dev/null
test_begin_subtest "headers do not have adjacent term positions"
-test_subtest_known_broken
# Regression test for a bug where term positions for non-prefixed
# terms weren't updated
output=$(notmuch search id:termpos and '"com dest"')
test_expect_equal "$output" ""
test_begin_subtest "parts have non-overlapping term positions"
-test_subtest_known_broken
output=$(notmuch search id:termpos and '"a y c"')
test_expect_equal "$output" ""