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: setup.rb
    path of file: ./repos/sunspot/sunspot/lib/sunspot
    
    the code of the file until where you have to start completion: module Sunspot
  # 
  # This class encapsulates the search/indexi
    
    def add_join_field_factory(name, type, options = {}, &block)
      field_factory = FieldFactory::Join.new(name, type, options, &block)
      @field_factories[field_factory.signature] = field_factory

      if type.is_a?(Type::TextType)
        @text_field_factories_cache[field_factory.name] = field_factory
      else
        @field_factories_cache[field_factory.name] = field_factory
      end