discourse/discourse · error · Discourse::NotFound

Discourse::NotFound

Error message

Discourse::NotFound

What it means

Error "Discourse::NotFound" thrown in discourse/discourse.

Source

Thrown at app/controllers/admin/search_logs_controller.rb:18

# frozen_string_literal: true

class Admin::SearchLogsController < Admin::StaffController
  def index
    period = params[:period] || "all"
    search_type = params[:search_type] || "all"
    render_serialized(SearchLog.trending(period&.to_sym, search_type&.to_sym), SearchLogsSerializer)
  end

  def term
    params.require(:term)

    term = params[:term]
    period = params[:period] || "quarterly"
    search_type = params[:search_type] || "all"

    details = SearchLog.term_details(term, period&.to_sym, search_type&.to_sym)
    raise Discourse::NotFound if details.blank?

    result = Search.execute(params[:term], guardian: guardian)
    details[:search_result] = serialize_data(result, GroupedSearchResultSerializer, result: result)
    render_json_dump(term: details)
  end
end

View on GitHub (pinned to 1b2d7253e8)

When it happens

Trigger: Thrown at app/controllers/admin/search_logs_controller.rb:18 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of discourse/discourse@1b2d7253e8 (2026-08-26). Data as JSON: /api/errors/e712e3c111dc2050. Report an issue: GitHub.