Changeset 316
- Timestamp:
- 05/05/08 03:20:07 (7 months ago)
- Files:
-
- trunk/lib/picolena/templates/app/models/indexer.rb (modified) (2 diffs)
- trunk/lib/picolena/templates/lib/tasks/index.rake (modified) (1 diff)
- trunk/lib/picolena/templates/spec/models/indexer_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/picolena/templates/app/models/indexer.rb
r301 r316 21 21 log :debug => "Now optimizing index" 22 22 index.optimize 23 index_time_dbm_file['last']=Time.now._dump 23 24 @@do_not_disturb_while_indexing=false 24 25 log :debug => "Indexing done in #{Time.now-start} s." … … 107 108 end 108 109 110 def last_update 111 Time._load(index_time_dbm_file['last']) rescue "none" 112 end 113 109 114 private 110 115 trunk/lib/picolena/templates/lib/tasks/index.rake
r305 r316 26 26 end 27 27 28 desc 'Returns the last time the index was created/update' 29 task :last_update => :environment do 30 puts Indexer.last_update 31 end 32 28 33 # Search index with query "some query" : 29 34 # rake index:search query="some query" trunk/lib/picolena/templates/spec/models/indexer_spec.rb
r301 r316 5 5 Indexer.index.writer.max_buffer_memory.should > 2**25-1 6 6 end 7 8 it "should know the time it was updated" do 9 Indexer.should respond_to(:last_update) 10 begin 11 Indexer.last_update.should be_kind_of(Time) 12 rescue 13 Indexer.last_update.should == "none" 14 end 15 end 7 16 end
