* [PATCH 1/2] searchidx: simplify ghost creation
2016-06-21 4:28 6% [PATCH 0/2] searchidx: fix ghost vivification Eric Wong
@ 2016-06-21 4:28 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-06-21 4:28 UTC (permalink / raw)
To: meta
Remove some worthless parameters and redundant no-ops
to make the next (important) patch easier-to-review.
---
lib/PublicInbox/SearchIdx.pm | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index a259d86..3134687 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -150,11 +150,11 @@ sub add_message {
if ($was_ghost) {
$doc_id = $smsg->doc_id;
- $self->link_message($smsg, 0);
+ $self->link_message($smsg);
$doc->set_data($smsg->to_doc_data);
$db->replace_document($doc_id, $doc);
} else {
- $self->link_message($smsg, 0);
+ $self->link_message($smsg);
$doc->set_data($smsg->to_doc_data);
$doc_id = $db->add_document($doc);
}
@@ -211,16 +211,6 @@ sub next_thread_id {
}
sub link_message {
- my ($self, $smsg, $is_ghost) = @_;
-
- if ($is_ghost) {
- $smsg->ensure_metadata;
- } else {
- $self->link_message_to_parents($smsg);
- }
-}
-
-sub link_message_to_parents {
my ($self, $smsg) = @_;
my $doc = $smsg->{doc};
my $mid = $smsg->mid;
@@ -414,17 +404,15 @@ sub _resolve_mid_to_tid {
}
sub create_ghost {
- my ($self, $mid, $tid) = @_;
-
- $tid = $self->next_thread_id unless defined $tid;
+ my ($self, $mid) = @_;
+ my $tid = $self->next_thread_id;
my $doc = Search::Xapian::Document->new;
$doc->add_term(xpfx('mid') . $mid);
$doc->add_term(xpfx('thread') . $tid);
$doc->add_term(xpfx('type') . 'ghost');
my $smsg = PublicInbox::SearchMsg->wrap($doc, $mid);
- $self->link_message($smsg, 1);
$self->{xdb}->add_document($doc);
$smsg;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] searchidx: fix ghost vivification
@ 2016-06-21 4:28 6% Eric Wong
2016-06-21 4:28 7% ` [PATCH 1/2] searchidx: simplify ghost creation Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-06-21 4:28 UTC (permalink / raw)
To: meta
These fix a message threading bug due to out-of-order message
delivery, leading messages not showing up properly in thread
views. Unfortunately this currently requires an index update
which cannot be done in place (yet).
Eric Wong (2):
searchidx: simplify ghost creation
searchidx: merge old thread id from ghosts
lib/PublicInbox/Search.pm | 3 ++-
lib/PublicInbox/SearchIdx.pm | 23 ++++++-----------------
2 files changed, 8 insertions(+), 18 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-06-21 4:28 6% [PATCH 0/2] searchidx: fix ghost vivification Eric Wong
2016-06-21 4:28 7% ` [PATCH 1/2] searchidx: simplify ghost creation Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).