Permalink
Browse files

Merge pull request #664 from Jashank/faster_lsi

faster_lsi: Massively accelerate LSI performance.
  • Loading branch information...
2 parents 2e76edd + 68333cd commit faf5e44c47d800b62178b139b7246553033c272c @parkr parkr committed Jan 17, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/jekyll/post.rb
View
7 lib/jekyll/post.rb
@@ -183,9 +183,12 @@ def related_posts(posts)
if self.site.lsi
self.class.lsi ||= begin
- puts "Running the classifier... this could take a while."
- lsi = Classifier::LSI.new
+ puts "Starting the classifier..."
+ lsi = Classifier::LSI.new(:auto_rebuild => false)
+ $stdout.print(" Populating LSI... ");$stdout.flush
posts.each { |x| $stdout.print(".");$stdout.flush;lsi.add_item(x) }
+ $stdout.print("\n Rebuilding LSI index... ")
+ lsi.build_index
puts ""
lsi
end

0 comments on commit faf5e44

Please sign in to comment.