X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchMsg.pm;h=6c0780e5906424f845bafd2e3f14ed09e849e620;hp=f5510b8e6b6f79c657fb3938460f9e4100e89f67;hb=35ff6bb106909b1c1232666a9792156dfa398ea8;hpb=7503aeb540af5afd5cb1b554b3c29f35f5fc918d diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index f5510b8e..6c0780e5 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -13,9 +13,7 @@ use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp); sub new { my ($class, $mime) = @_; my $doc = Search::Xapian::Document->new; - $doc->add_boolean_term('T' . 'mail'); - - bless { type => 'mail', doc => $doc, mime => $mime }, $class; + bless { doc => $doc, mime => $mime }, $class; } sub wrap { @@ -52,6 +50,7 @@ sub to_doc_data { ); } + sub load_from_data ($$) { my ($self) = $_[0]; # data = $_[1] ( @@ -187,26 +186,9 @@ sub mid ($;$) { sub _extract_mid { mid_clean(mid_mime($_[0]->{mime})) } -sub thread_id { - my ($self) = @_; - my $tid = $self->{thread}; - return $tid if defined $tid; - $self->{thread} = _get_term_val($self, 'G', qr/\AG/); # *G*roup -} +sub tid { $_[0]->{tid} } # XXX: consider removing this, we can phrase match subject -sub path { - my ($self) = @_; - my $path = $self->{path}; - return $path if defined $path; - $self->{path} = _get_term_val($self, 'XPATH', qr/\AXPATH/); # path -} - -sub type { - my ($self) = @_; - my $type = $self->{type}; - return $type if defined $type; - $self->{type} = _get_term_val($self, 'T', qr/\AT/); -} +sub path { $_[0]->{path} } 1;