Question

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?

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top