]> Sergey Matveev's repositories - public-inbox.git/commit
SearchIdx.pm: Make indexing search positions optional
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 18 Jul 2018 16:53:23 +0000 (11:53 -0500)
committerEric Wong <e@80x24.org>
Thu, 19 Jul 2018 03:08:16 +0000 (03:08 +0000)
commit5d051e1de434490f46bff8bce82010a37a184976
tree709fde945ff6a4d2bdf7269306e6adea2128e837
parent90577102f4eabdf57b570457062de07398b72415
SearchIdx.pm: Make indexing search positions optional

About half the size of the Xapian search index turns out to be search
positions.  The search positions are only used in a very narrow set of
queries.  Make the search positions optional so people don't need to
pay the cost of queries they will never make.

This also makes public-inbox more approachable for light hacking as
generating all of the indexes is time consuming.

The way this is done is to add a method to SearchIdx called index_text
that wraps the call of the term generator method index_text.  The new
index_text method takes care of calling both index_text and
increase_termpos (the two functions that are responsible for position
data).

Then index_users, index_diff_inc, index_old_diff_fn, index_diff,
index_body are made proper methods that calls the new index_text.
Callers of the new index_text are slightly simplified as they don't
need to call increase_termpos as well.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
lib/PublicInbox/SearchIdx.pm