Sha256: 9b0bdb070cd839a5048c8cc66974de23f9d39365e12e40be639241246e983bd9
Contents?: true
Size: 1.09 KB
Versions: 3
Compression:
Stored size: 1.09 KB
Contents
#!/usr/bin/env ruby # encoding: UTF-8 require File.expand_path(File.dirname(__FILE__) + '/../config/boot') require 'druid-tools' require 'optparse' def main(flags) Dir.glob('/var/geomdtk/current/workspace/**/ogpSolr.xml') do |fn| puts "Uploading #{fn}" system('curl -X POST -H "Content-Type: text/xml" ' + "--data-binary @#{fn} " + "#{flags[:solr]}/#{flags[:collection]}/update") end system("curl '#{flags[:solr]}/#{flags[:collection]}/update?commit=true'") system("curl '#{flags[:solr]}/#{flags[:collection]}/update?optimize=true'") end # __MAIN__ begin flags = { :debug => false, :verbose => false, :collection => GeoHydra::Config.ogp.solr.collection || 'ogp', :solr => GeoHydra::Config.ogp.solr.url } OptionParser.new do |opts| opts.banner = <<EOM Usage: #{File.basename(__FILE__)} [options] EOM opts.on('-v', '--verbose', 'Run verbosely') do |v| flags[:debug] = true if flags[:verbose] flags[:verbose] = true end end.parse! main flags rescue SystemCallError => e $stderr.puts "ERROR: #{e.message}" exit(-1) end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
geohydra-0.3.3 | scripts/solr_indexer.rb |
geohydra-0.3.1 | bin/solr_indexer.rb |
geohydra-0.3 | bin/solr_indexer.rb |