Add yield to indexer, allowing client to have final control over the Solr document indexed after the mapping has been made

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@522532 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-03-26 14:52:39 +00:00
parent cd9862fceb
commit ff396cac79
1 changed files with 1 additions and 2 deletions

View File

@ -18,8 +18,7 @@ class Solr::Indexer
data_source.each do |record|
document = mapper.map(record)
# yield(document) if block_given? # TODO: does yielding add value here? possibly to allow the caller
# to manipulate the document outside of mappings just before indexing?
yield(record, document) if block_given?
solr.add(document) unless options[:debug]
puts document.inspect if options[:debug]