Class: Sunspot::Query::Sort::RandomSort

Inherits:
Abstract
  • Object
show all
Defined in:
lib/sunspot/query/sort.rb

Overview

A RandomSort uses Solr’s random field functionality to sort results (usually) randomly.

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Sunspot::Query::Sort::Abstract

Instance Method Details

#to_paramObject



79
80
81
# File 'lib/sunspot/query/sort.rb', line 79

def to_param
  "random_#{rand(1<<16)} #{direction_for_solr}"
end