def log_search
      if params[:query].present? && params[:page].present?
        @session.searches.create(query: params[:query], page: params[:page])
        head :ok
      else
        head :bad_request
      end
    end
def log_search
      if params[:query].present? && params[:page].present?
        @session.searches.create(query: params[:query], page: params[:page])
        head :ok
      else
        head :bad_request
      end
    end
Logs a search to the database

 This is an API endpoint for logging a search. It requires that at least a search query and a page are
 present in the query parameters. It returns a 200 OK HTTP status if the request was successful, or
 an 400 BAD REQUEST HTTP status if any parameters are missing.