Skip to content
Snippets Groups Projects
Commit 060dd7a8 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

fix score worker

parent e7a0f77f
No related branches found
No related tags found
No related merge requests found
......@@ -23,22 +23,6 @@ class SearchController < ApplicationController
unless params[:query].blank?
objectsFound = search params
@numFound = objectsFound.length
# case params[:order]
# items = objectsFound.collect{ |x| Ranking::Item.new(x.name,x.views,0,x.likes,x) } #puts each object in an item
#
# rater = Ranking::Rater.new(
# Ranking::Strategies::BasicRater.new(
# #define ordering weights
# positionWeight = 1000,
# useWeight = 1,
# likeWeight = 100
# )
# )
#
# a = rater.orderByRate(items) # Returns ordered array of items
# objectsFound = a.collect{ |x| x.info } #get only the info fields(objects)
# end
end
@result = Kaminari.paginate_array(objectsFound).page(page).per(@pagination_limit)
......
......@@ -343,11 +343,10 @@
<input type="hidden" name="qry" value="<%= params["qry"] %>">
<select class="order sort-dropdown" name="order">
<option value="">ordenar resultados</option>
<option value="">relevância</option>
<option value="author">autores</option>
<option value="publicationasc">mais novos</option>
<option value="publicationdesc">mais velhos</option>
<option value="relevance">relevância</option>
<option value="title">título</option>
</select>
</form>
......
......@@ -22,7 +22,7 @@ class ScoreCalculatorWorker
score += (views / learning_object_repository.max_views)*weights[:views] unless views < 1
# 30 points if it has description
score += weights[:description] unless object.decription.empty?
score += weights[:description] unless object.description.empty?
learning_object_repository.update_property(object, 'score', score)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment