Since we support duplicate MIDs in v2, the NNTP article number
becomes the true unique identifier and we want a way to do fast
lookups on it.
While we're at it, stop putting XPATH in the term partitions
since we only need it in the skeleton DB.
if ($subj ne '') {
$xpath = $self->subject_path($subj);
$xpath = id_compress($xpath);
if ($subj ne '') {
$xpath = $self->subject_path($subj);
$xpath = id_compress($xpath);
- $doc->add_boolean_term('XPATH' . $xpath);
}
my $lines = $mime->body_raw =~ tr!\n!\n!;
}
my $lines = $mime->body_raw =~ tr!\n!\n!;
$skel->index_skeleton(\@values);
$doc_id = $self->{xdb}->add_document($doc);
} else {
$skel->index_skeleton(\@values);
$doc_id = $self->{xdb}->add_document($doc);
} else {
- $doc_id = link_and_save($self, $doc, $mids, $refs);
+ $doc_id = link_and_save($self, $doc, $mids, $refs,
+ $num, $xpath);
- my ($self, $doc, $mids, $refs) = @_;
+ my ($self, $doc, $mids, $refs, $num, $xpath) = @_;
my $db = $self->{xdb};
my $old_tid;
my $doc_id;
my $db = $self->{xdb};
my $old_tid;
my $doc_id;
+ $doc->add_boolean_term('XNUM' . $num) if defined $num;
+ $doc->add_boolean_term('XPATH' . $xpath) if defined $xpath;
my $vivified = 0;
foreach my $mid (@$mids) {
$self->each_smsg_by_mid($mid, sub {
my $vivified = 0;
foreach my $mid (@$mids) {
$self->each_smsg_by_mid($mid, sub {
my $ts = $values->[PublicInbox::Search::TS];
my $smsg = PublicInbox::SearchMsg->new(undef);
my $doc = $smsg->{doc};
my $ts = $values->[PublicInbox::Search::TS];
my $smsg = PublicInbox::SearchMsg->new(undef);
my $doc = $smsg->{doc};
- $doc->add_boolean_term('XPATH' . $xpath) if defined $xpath;
foreach my $mid (@$mids) {
$doc->add_term('Q' . $mid);
}
foreach my $mid (@$mids) {
$doc->add_term('Q' . $mid);
}
$doc->set_data($doc_data);
$smsg->{ts} = $ts;
$smsg->load_from_data($doc_data);
$doc->set_data($doc_data);
$smsg->{ts} = $ts;
$smsg->load_from_data($doc_data);
+ my $num = $values->[PublicInbox::Search::NUM];
my @refs = ($smsg->references =~ /<([^>]+)>/g);
my @refs = ($smsg->references =~ /<([^>]+)>/g);
- $self->link_and_save($doc, $mids, \@refs);
+ $self->link_and_save($doc, $mids, \@refs, $num, $xpath);