Changeset 305
- Timestamp:
- 05/02/08 04:53:33 (7 months ago)
- Files:
-
- trunk/lib/picolena/templates/app/models/document.rb (modified) (3 diffs)
- trunk/lib/picolena/templates/lib/tasks/index.rake (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/picolena/templates/app/models/document.rb
r301 r305 16 16 } 17 17 alias_method :filename, :basename 18 alias_method :to_s, :complete_path 19 20 21 def inspect 22 [self,("(#{pretty_score})" if @score),("(language:#{language})" if language)].compact.join(" ") 23 end 24 25 18 26 19 27 # Returns filename without extension … … 92 100 end 93 101 102 def pretty_score 103 "%3.1f%" % (@score*100) 104 end 105 94 106 # Fields that are shared between every document. 95 107 def self.default_fields_for(complete_path) … … 103 115 } 104 116 end 117 105 118 106 119 private trunk/lib/picolena/templates/lib/tasks/index.rake
r281 r305 30 30 desc 'Search index' 31 31 task :search => :environment do 32 Finder.new(ENV["query"]).matching_documents.entries.each{|doc| puts doc.to_s}32 puts Finder.new(ENV["query"]).matching_documents.entries.collect{|doc| doc.inspect}.join("\n"<<"#"*80<<"\n") 33 33 end 34 34 end
