You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by eh...@apache.org on 2007/03/26 16:52:43 UTC
svn commit: r522532 -
/lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb
Author: ehatcher
Date: Mon Mar 26 07:52:39 2007
New Revision: 522532
URL: http://svn.apache.org/viewvc?view=rev&rev=522532
Log:
Add yield to indexer, allowing client to have final control over the Solr document indexed after the mapping has been made
Modified:
lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb
Modified: lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb?view=diff&rev=522532&r1=522531&r2=522532
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/indexer.rb Mon Mar 26 07:52:39 2007
@@ -18,8 +18,7 @@
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]