diff --git a/client/ruby/solr-ruby/lib/solr/indexer.rb b/client/ruby/solr-ruby/lib/solr/indexer.rb index 9089b373b9d..4b8b5661b6c 100755 --- a/client/ruby/solr-ruby/lib/solr/indexer.rb +++ b/client/ruby/solr-ruby/lib/solr/indexer.rb @@ -11,7 +11,8 @@ # limitations under the License. class Solr::Indexer - def self.index(data_source, mapper, options={}) + def self.index(data_source, mapper_or_mapping, options={}) + mapper = mapper_or_mapping.is_a?(Hash) ? Solr::Importer::Mapper.new(mapper_or_mapping) : mapper_or_mapping solr_url = options[:solr_url] || ENV["SOLR_URL"] || "http://localhost:8983/solr" solr = Solr::Connection.new(solr_url, options) #TODO - these options contain the solr_url and debug keys also, so tidy up what gets passed