Skip to content

Instantly share code, notes, and snippets.

@brianjriddle
Created February 17, 2010 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjriddle/306448 to your computer and use it in GitHub Desktop.
Save brianjriddle/306448 to your computer and use it in GitHub Desktop.
require 'java'
require File.expand_path "lucene-core-1.9.1.jar"
module Lucene
include_package "org.apache.lucene.index"
include_package "org.apache.lucene.store"
include_package "org.apache.lucene.analysis.standard"
end
if ARGV.length == 1
writer = Lucene::IndexWriter.new(Lucene::FSDirectory.getDirectory(ARGV[0], false), Lucene::StandardAnalyzer.new, false)
puts "starting optimze of #{writer}"
writer.optimize
else
puts "usage #{__FILE__} index"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment