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

module Gql::Queries
  class AutocompleteSearch::MergeTicket < BaseQuery

    description 'Search for tickets'

    argument :input, Gql::Types::Input::AutocompleteSearch::MergeTicketInputType, required: true, description: 'The input object for the autocomplete search'

    type [Gql::Types::AutocompleteSear
    
    def search_index(query:, limit:, source_ticket:)
      # We have to filter out the states afterwards, because the search method can only handle either query OR condition.
      ::Ticket.search(
        current_user: context.current_user,
        query:        query,
        scope:        TicketPolicy::ChangeScope,
        limit:        limit,
        sort_by:      'created_at',
        order_by:     'desc',
      ).reject do |ticket|
        ignore_state_ids.include?(ticket.state_id) || source_ticket.id == ticket.id
      end
    end