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: search.rb
    path of file: ./repos/zammad/app/models/knowledge_base
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

class KnowledgeBase
  module Search
    extend ActiveSupport::Concern

    class
    
      def search_es(query, kb_locales, options)
        options[:query_extension] = { bool: { filter: { terms: { kb_locale_id: kb_locales.map(&:id) } } } }

        es_response = SearchIndexBackend.search(query, name, options)
        es_response = search_es_filter(es_response, query, kb_locales, options) if defined? :search_es_filter

        es_response.filter_map { |item| lookup(id: item[:id]) }
      end