docbrown/app/controllers/search_controller.rb

11 lines
312 B
Ruby

class SearchController < ApplicationController
before_action :authenticate_user!
def tags
tag_docs = Search::Tag.search_documents("name:#{params[:name]}* AND supported:true")
render json: { result: tag_docs }
rescue Search::Errors::Transport::BadRequest
render json: { result: [] }
end
end