Method: Sphinx::Client#SetSortMode

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

#SetSortMode(mode, sortby = '') ⇒ Object

Set matches sorting mode.



279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/sphinx/sphinx/client.rb', line 279

def SetSortMode(mode, sortby = '')
  assert { mode == SPH_SORT_RELEVANCE \
        || mode == SPH_SORT_ATTR_DESC \
        || mode == SPH_SORT_ATTR_ASC \
        || mode == SPH_SORT_TIME_SEGMENTS \
        || mode == SPH_SORT_EXTENDED \
        || mode == SPH_SORT_EXPR }
  assert { sortby.instance_of? String }
  assert { mode == SPH_SORT_RELEVANCE || !sortby.empty? }

  @sort = mode
  @sortby = sortby
end