On Apr 21, 2007, at 9:42 PM, Erik Hatcher wrote:
source = DataSource.new

mapping = {
  :id => :isbn,
  :name => :author,
  :source => "BOOKS",
  :year => Proc.new {|record| record.date[0,4] },
}

Solr::Indexer.index(source, mapper) do |orig_data, solr_document|
  solr_document[:timestamp] = Time.now
end

Sorry, my bad, that's what I get for contriving code without testing it, and then changing the implementation to suit how I wanted to describe it.

It should be Solr::Indexer.index(source, mapping) ....  # mappING

I just changed the implementation to allow a Hash as well as a Solr::Importer::Mapper object (well, really anything with a #map method).

        Erik



Reply via email to