Changeset 120
- Timestamp:
- 12/19/06 21:54:21 (2 years ago)
- Files:
-
- trunk/.todo (added)
- trunk/demo/test/unit/comment_test.rb (modified) (1 diff)
- trunk/plugin/acts_as_ferret/lib/class_methods.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demo/test/unit/comment_test.rb
r111 r120 160 160 end 161 161 162 # fails due to Ferret bug in 0.10.13, http://pastie.caboo.se/22886163 162 def test_stopwords 164 163 comment = Comment.create( :author => 'john doe', :content => 'Move or shake' ) trunk/plugin/acts_as_ferret/lib/class_methods.rb
r119 r120 93 93 ferret_configuration = { 94 94 :or_default => false, 95 :handle_parse_errors => true 95 :handle_parse_errors => true, 96 :default_field => '*' 96 97 #:max_clauses => 512, 97 #:default_field => '*',98 98 #:analyzer => Ferret::Analysis::StandardAnalyzer.new, 99 99 # :wild_card_downcase => true … … 142 142 EOV 143 143 FerretMixin::Acts::ARFerret::ensure_directory configuration[:index_dir] 144 145 # now that all fields have been added, we can initialize the default 146 # field list to be used by the query parser. 147 # It will include all content fields *not* marked as :untokenized. 148 # This fixes the otherwise failing CommentTest#test_stopwords 149 ferret_configuration[:default_field] = fields_for_ferret.keys.select do |f| 150 fields_for_ferret[f][:index] != :untokenized 151 end 152 logger.debug "set default field list to #{ferret_configuration[:default_field].inspect}" 144 153 end 145 154 … … 399 408 result = [] 400 409 index = self.ferret_index 410 # puts "query: #{index.process_query q}" 401 411 total_hits = index.search_each(q, options) do |hit, score| 402 412 # only collect result data if we intend to return it
