Method: Sphinx::Client#SetLimits

Defined in:
lib/sphinx/sphinx/client.rb

#SetLimits(offset, limit, max = 0, cutoff = 0) ⇒ Object

Set offset and count into result set, and optionally set max-matches and cutoff limits.



232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/sphinx/sphinx/client.rb', line 232

def SetLimits(offset, limit, max = 0, cutoff = 0)
  assert { offset.instance_of? Fixnum }
  assert { limit.instance_of? Fixnum }
  assert { max.instance_of? Fixnum }
  assert { offset >= 0 }
  assert { limit > 0 }
  assert { max >= 0 }

  @offset = offset
  @limit = limit
  @maxmatches = max if max > 0
  @cutoff = cutoff if cutoff > 0
end