Skip to content

Commit

Permalink
Merge pull request #136 from OpenGeoMetadata/indexer-solr-url
Browse files Browse the repository at this point in the history
Support querying the configured solr url when indexing
  • Loading branch information
eliotjordan committed Jan 27, 2023
2 parents 7a42aaa + a8af87c commit e3d91fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/geo_combine/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def initialize(solr: GeoCombine::Indexer.solr)
@solr = solr
end

def solr_url
@solr.options[:url]
end

# Index everything and return the number of docs successfully indexed
def index(docs, commit_within: ENV.fetch('SOLR_COMMIT_WITHIN', 5000).to_i)
indexed_count = 0
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/geo_combine.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace :geocombine do
task :index do
harvester = GeoCombine::Harvester.new
indexer = GeoCombine::Indexer.new
puts "Indexing #{harvester.ogm_path} into #{indexer.solr.url}"
puts "Indexing #{harvester.ogm_path} into #{indexer.solr_url}"
total = indexer.index(harvester.docs_to_index)
puts "Indexed #{total} documents"
end
Expand Down

0 comments on commit e3d91fa

Please sign in to comment.