2012-11-21 12:09:01 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
|
|
|
class Api::V1::SearchController < Api::V1::BaseController
|
|
|
|
before_filter :authenticate_user! unless APP_CONFIG['anonymous_access']
|
|
|
|
|
|
|
|
def index
|
2012-11-21 15:04:41 +00:00
|
|
|
@results = Search.by_term_and_type(
|
|
|
|
params[:query],
|
|
|
|
(params[:type] || 'all'),
|
|
|
|
paginate_params
|
|
|
|
)
|
2012-11-21 12:09:01 +00:00
|
|
|
end
|
|
|
|
end
|