search_controller.rb 370 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1
2
class SearchController < ApplicationController
  def index
Zac Wood's avatar
Zac Wood committed
3
    results = SearchHelper::GenericItem.fetchall(String.new(params[:query]), semester: @semester).group_by(&:type)
Zac Wood's avatar
Zac Wood committed
4
5
6
7

    # results = search(params[:query])
    @instructors = results[:instructor]&.map(&:data)
    @courses = results[:course]&.map(&:data)
Zac Wood's avatar
Zac Wood committed
8
  end
Zac Wood's avatar
Zac Wood committed
9
10
11

  # cases
  # math 113 - [a-zA-Z]{3,} [1-9]{3}
Zac Wood's avatar
Zac Wood committed
12
end