user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 6/6] searchidx: remove_message: pedantic fix for v1
  2020-01-03  8:45  6% [PATCH 0/6] searchidx: minor fix and some cleanups Eric Wong
@ 2020-01-03  8:46  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-03  8:46 UTC (permalink / raw)
  To: meta

It shouldn't be possible for v1 inboxes to have multiple matches
for a given Message-ID, so the sub would only get called once,
but strange things could happen in 2112 :>
---
 lib/PublicInbox/SearchIdx.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index ca1457fd..0d983aab 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -433,7 +433,7 @@ sub remove_message {
 		batch_do($self, 'Q' . $mid, sub {
 			my ($ids) = @_;
 			$db->delete_document($_) for @$ids;
-			$nr = scalar @$ids;
+			$nr += scalar @$ids;
 		});
 	};
 	if ($@) {

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] searchidx: minor fix and some cleanups
@ 2020-01-03  8:45  6% Eric Wong
  2020-01-03  8:46  7% ` [PATCH 6/6] searchidx: remove_message: pedantic fix for v1 Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-03  8:45 UTC (permalink / raw)
  To: meta

1/6 is a real bug fix, 4/6 is a nice simplification
and the rest makes reading easier when I haven't looked
at the indexing code in a while.

Xapian indexing is still expensive, though...

Eric Wong (6):
  searchidx: index_diff: allow /^$/ line as diff context
  searchidx: split off index_xapian for msg_iter
  searchidx: add_message: fix and make use of prototypes
  searchidx: simplify quote-splitting in index_body
  searchidx: index_text: use Xapian parameter names
  searchidx: remove_message: pedantic fix for v1

 lib/PublicInbox/SearchIdx.pm | 177 ++++++++++++++++-------------------
 1 file changed, 83 insertions(+), 94 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 --
2020-01-03  8:45  6% [PATCH 0/6] searchidx: minor fix and some cleanups Eric Wong
2020-01-03  8:46  7% ` [PATCH 6/6] searchidx: remove_message: pedantic fix for v1 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).