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 02/10] search: drop longer subject: prefix for search
  2016-09-09  0:01  5% [PATCH 0/10] search: more mairix prefix compatibility Eric Wong
@ 2016-09-09  0:01  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-09-09  0:01 UTC (permalink / raw)
  To: meta

We only document the "s:" anyways.  While the long name is more
descriptive, the ambiguity makes agnostic caching (by Varnish or
similar) slightly harder and longer URLs are more likely to be
accidentally truncated when shared.
---
 lib/PublicInbox/Search.pm |  1 -
 t/search.t                | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index aec459b..3b25b66 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -58,7 +58,6 @@ my %bool_pfx_external = (
 );
 
 my %prob_prefix = (
-	subject => 'S',
 	s => 'S', # for mairix compatibility
 	m => 'Q', # 'mid' is exact, 'm' can do partial
 	f => 'A', # for mairix compatibility
diff --git a/t/search.t b/t/search.t
index bb0861a..7abaf83 100644
--- a/t/search.t
+++ b/t/search.t
@@ -123,19 +123,19 @@ sub filter_mids {
 		is($res->{total}, 0, "path variant `$p' does not match");
 	}
 
-	$res = $ro->query('subject:(Hello world)');
+	$res = $ro->query('s:(Hello world)');
 	@res = filter_mids($res);
-	is_deeply(\@res, \@exp, 'got expected results for subject:() match');
+	is_deeply(\@res, \@exp, 'got expected results for s:() match');
 
-	$res = $ro->query('subject:"Hello world"');
+	$res = $ro->query('s:"Hello world"');
 	@res = filter_mids($res);
-	is_deeply(\@res, \@exp, 'got expected results for subject:"" match');
+	is_deeply(\@res, \@exp, 'got expected results for s:"" match');
 
-	$res = $ro->query('subject:"Hello world"', {limit => 1});
+	$res = $ro->query('s:"Hello world"', {limit => 1});
 	is(scalar @{$res->{msgs}}, 1, "limit works");
 	my $first = $res->{msgs}->[0];
 
-	$res = $ro->query('subject:"Hello world"', {offset => 1});
+	$res = $ro->query('s:"Hello world"', {offset => 1});
 	is(scalar @{$res->{msgs}}, 1, "offset works");
 	my $second = $res->{msgs}->[0];
 
@@ -181,7 +181,7 @@ sub filter_mids {
 	$rw_commit->();
 	$ro->reopen;
 
-	# Subject:
+	# subject
 	my $res = $ro->query('ghost');
 	my @exp = sort qw(ghost-message@s ghost-reply@s);
 	my @res = filter_mids($res);
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/10] search: more mairix prefix compatibility
@ 2016-09-09  0:01  5% Eric Wong
  2016-09-09  0:01  7% ` [PATCH 02/10] search: drop longer subject: prefix for search Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-09-09  0:01 UTC (permalink / raw)
  To: meta

This brings us closer to the behavior of mairix(1) for search
by supporting n:, t:, c:, f:, tc:, tcf:, n:, b:, and bs:
prefixes as documented in the mairix(1) manpage.

We also introduce the use of q: and nq: prefixes for quoted and
non-quoted text, respectively.

There is a schema version change in [PATCH 7/10] to maintain
compatibility with Debian 7.x wheezy installs.  The in-place
reindexing would've been expensive anyways, so perhaps the
schema bump is a good idea, anyways, as creating a fresh index
should be faster than --reindex.

Eric Wong (10):
      search: allow searching user fields (To/Cc/From)
      search: drop longer subject: prefix for search
      search: more granular message body searching
      search: fix space regressions from recent changes
      search: match quote detection behavior of view
      search: increase term positions for each quoted hunk
      search: fix compatibility with Debian wheezy
      search: avoid mindlessly calling body_set
      search: match the behavior of WWW for indexing text
      search: index attachment filenames

 lib/PublicInbox/Search.pm    |  32 +++++++++---
 lib/PublicInbox/SearchIdx.pm | 104 ++++++++++++++++++++++++-------------
 t/search.t                   | 120 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 206 insertions(+), 50 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 --
2016-09-09  0:01  5% [PATCH 0/10] search: more mairix prefix compatibility Eric Wong
2016-09-09  0:01  7% ` [PATCH 02/10] search: drop longer subject: prefix for search 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).