lib/revs-utils.rb in revs-utils-2.1.0 vs lib/revs-utils.rb in revs-utils-2.1.1
- old
+ new
@@ -78,10 +78,10 @@
# these are used in the revs solr document in the main revs digital library rails app, as well as the revs-indexing-service app
def revs_compute_score(doc_hash)
total_score=0
total_weights=0
- field_mappings.each do |field_name,field_config|
+ revs_field_mappings.each do |field_name,field_config|
if !field_config[:weight].blank?
total_score += field_config[:weight].to_f * (blank_value?(doc_hash[field_config[:field]]) ? 0 : 1) # if the field is blank, it is a 0 regardless of weight, otherwise it is a 1 times its weight
total_weights += field_config[:weight].to_f
end
end