You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: user.rb
    path of file: ./repos/forem/app/services/search
    
    the code of the file until where you have to start completion: module Search
  class User
    ATTRIBUTES = %i[
      id
      name
      profile_image
      username
    ].freeze

    DEFAULT_PER_PAGE = 60
    MAX_PER_PAGE = 100

    HOTNESS_SCORE_ORDER = Arel.sql(%{
      (((articles_count + comments_count + reactions_count + badge_achievements_count) * 10) * reputation_modifier)
      DESC
    }.squish).freeze

    def self.search_documents(term: nil, sort_by: :nil, sort_direction: :desc, page: 0, per_page: DEFAULT_PER_PAGE)
      # NOTE: we should
    
    def self.search_documents(term: nil, sort_by: :nil, sort_direction: :desc, page: 0, per_page: DEFAULT_PER_PAGE)
      # NOTE: we should eventually update the frontend
      # to start from page 1
      page = page.to_i + 1
      per_page = [(per_page || DEFAULT_PER_PAGE).to_i, MAX_PER_PAGE].min

      relation = ::User

      relation = filter_suspended_users(relation)

      relation = relation.registered

      relation = relation.search_by_name_and_username(term) if term.present?

      relation = relation.select(*ATTRIBUTES)

      relation = sort(relation, sort_by, sort_direction)

      relation = relation.page(page).per(per_page)

      serialize(relation)
    end