lib/fields/sort.js
function sort(type) {
  if (!~SORT_TYPES.indexOf(type)) {
    throw new FieldError('Sorting type can be ' + SORT_TYPES.join(' or '))
  }

  return {
    type: type
  }
}
function sort(type) {
  if (!~SORT_TYPES.indexOf(type)) {
    throw new FieldError('Sorting type can be ' + SORT_TYPES.join(' or '))
  }

  return {
    type: type
  }
}
function sort ( type ) { if ( ! ~ SORT_TYPES . indexOf ( type ) ) { throw new FieldError ( 'Sorting type can be ' + SORT_TYPES . join ( ' or ' ) ) } return { type : type } }
Set sort field

@see http://druid.io/docs/0.6.121/SearchQuerySpec.html
@param {string} type Sort type
@returns {object}
Set sort field