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 9/9] search: apply mid_compression to subject paths, too
  2015-08-17  3:38  5% [PATCH 0/9] search pushed and deployed to master Eric Wong
@ 2015-08-17  3:38  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-08-17  3:38 UTC (permalink / raw)
  To: meta

Otherwise we'll be wasting space in our index for long
subjects.
---
 lib/PublicInbox/Search.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 051f7a5..862ed6d 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -15,7 +15,8 @@ use constant {
 	# SCHEMA_VERSION history
 	# 0 - initial
 	# 1 - subject_path is lower-cased
-	SCHEMA_VERSION => 1,
+	# 2 - subject_path is mid_compressed in the index, only
+	SCHEMA_VERSION => 2,
 	LANG => 'english',
 	QP_FLAGS => FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE|FLAG_WILDCARD,
 };
@@ -113,7 +114,7 @@ sub add_message {
 			$doc->add_term(xpfx('subject') . $subj);
 
 			my $path = subject_path($subj);
-			$doc->add_term(xpfx('path') . $path);
+			$doc->add_term(xpfx('path') . mid_compressed($path));
 		}
 
 		my $from = $smsg->from_name;
@@ -214,7 +215,7 @@ sub query {
 
 sub get_subject_path {
 	my ($self, $path, $opts) = @_;
-	my $query = $self->qp->parse_query("path:$path", 0);
+	my $query = $self->qp->parse_query("path:".mid_compressed($path), 0);
 	$self->do_enquire($query);
 }
 
@@ -238,7 +239,7 @@ sub get_thread {
 	return { count => 0, msgs => [] } unless $smsg;
 	my $qp = $self->qp;
 	my $qtid = $qp->parse_query('thread:'.$smsg->thread_id);
-	my $qsub = $qp->parse_query('path:'.$smsg->path);
+	my $qsub = $qp->parse_query('path:'.mid_compressed($smsg->path));
 	my $query = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
 	$self->do_enquire($query);
 }
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] search pushed and deployed to master
@ 2015-08-17  3:38  5% Eric Wong
  2015-08-17  3:38  7% ` [PATCH 9/9] search: apply mid_compression to subject paths, too Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-08-17  3:38 UTC (permalink / raw)
  To: meta

This should appear shortly in: http://public-inbox.org/meta/

Eric Wong (9):
      feed: remove unnecesary time paramenter in index state
      favor /t/ to /s/, since subjects may change mid-thread
      WWW: eliminate "top" parameter for feeds
      www: simplify parameter passing to feed
      terminology: replies => followups
      search: use raw headers without MIME decoding
      feed: disable the generator statement
      drop bodies and messages ASAP after processing
      search: apply mid_compression to subject paths, too

^ 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 --
2015-08-17  3:38  5% [PATCH 0/9] search pushed and deployed to master Eric Wong
2015-08-17  3:38  7% ` [PATCH 9/9] search: apply mid_compression to subject paths, too 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).