views:

176

answers:

1

Is there any way to retrieve relevance values with results with the array returned by ThinkingSphinx? Percentages, points or whatever, just something I can work with?

+2  A: 

Yep - you can iterate over the result set, and retrieve the weight for each:

results = ThinkingSphinx::Search.search(params[:q])
results.each_with_weighting do |result, weight|
  puts "#{result.name} #{weight}"
end
Mr. Matt