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 2/5] isearch: use numeric sort for article numbers
  2020-12-21  7:51  5% [PATCH 0/5] extindex->misc prep stuff Eric Wong
@ 2020-12-21  7:51  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-12-21  7:51 UTC (permalink / raw)
  To: meta

Perl sort is alphabetical by default and Xapian uses numeric
document IDs, so sort must be told explicitly to use numeric
comparisons even if the scalars are integer values (IV)
internally.

And eliminate extra hash marks ("#") since they're probably too
noisy if there are many IDs.

Note: I haven't seen this warning message in syslog, yet :>
---
 lib/PublicInbox/Isearch.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Isearch.pm b/lib/PublicInbox/Isearch.pm
index 8a1f257a..e362c80a 100644
--- a/lib/PublicInbox/Isearch.pm
+++ b/lib/PublicInbox/Isearch.pm
@@ -89,7 +89,7 @@ SELECT docid,xnum FROM xref3 WHERE ibx_id = ? AND docid IN ($qmarks)
 	}
 	if (scalar keys %order) {
 		warn "W: $self->{es}->{topdir} #",
-			join(', #', sort keys %order),
+			join(', ', sort { $a <=> $b } keys %order),
 			" not mapped to `$self->{eidx_key}'\n";
 		warn "W: $self->{es}->{topdir} may need to be reindexed\n";
 		@xnums = grep { defined } @xnums;
@@ -113,7 +113,7 @@ sub mset_to_smsg {
 	}
 	if (scalar keys %order) {
 		warn "W: $ibx->{inboxdir} #",
-			join(', #', sort keys %order),
+			join(', ', sort { $a <=> $b } keys %order),
 			" no longer valid\n";
 		warn "W: $self->{es}->{topdir} may need to be reindexed\n";
 	}

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/5] extindex->misc prep stuff
@ 2020-12-21  7:51  5% Eric Wong
  2020-12-21  7:51  7% ` [PATCH 2/5] isearch: use numeric sort for article numbers Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-12-21  7:51 UTC (permalink / raw)
  To: meta

Still working on speedups to startup time and no-op index
runs on thousands of inboxes, but a few small cleanups
and improvements along the way...

Eric Wong (5):
  inbox: delay ->version detection
  isearch: use numeric sort for article numbers
  use rel2abs_collapsed when loading Inbox objects
  searchidx: rename get_val to int_val and return IV
  extsearch*: drop unnecessary path canonicalization

 lib/PublicInbox/Admin.pm        | 11 +----------
 lib/PublicInbox/Config.pm       | 28 +++++++++++++++++++++++-----
 lib/PublicInbox/ExtSearch.pm    |  2 --
 lib/PublicInbox/ExtSearchIdx.pm |  7 -------
 lib/PublicInbox/Inbox.pm        |  8 +++-----
 lib/PublicInbox/Isearch.pm      |  4 ++--
 lib/PublicInbox/SearchIdx.pm    |  9 +++++----
 script/public-inbox-convert     |  2 +-
 script/public-inbox-init        |  2 +-
 t/search.t                      |  4 ++--
 10 files changed, 38 insertions(+), 39 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-12-21  7:51  5% [PATCH 0/5] extindex->misc prep stuff Eric Wong
2020-12-21  7:51  7% ` [PATCH 2/5] isearch: use numeric sort for article numbers 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).