lucene-ruby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: [acts_as_solr] Few question on usage
Date Sun, 22 Apr 2007 01:54:03 GMT

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




Mime
View raw message