lib/tire/multi_search.rb
# Add a search definition to the multi-search request.
#
# The usual search options such as `search_type`, `routing`, etc. can be passed as a Hash,
# and the search definition itself should be passed as a block using the Tire DSL.
#
Add a search definition to the multi-search request.
The usual search options such as `search_type`, `routing`, etc. can be passed as a Hash,
and the search definition itself should be passed as a block using the Tire DSL.
Add a search definition to the multi - search request . The usual search options such as ` search_type ` ` routing ` etc . can be passed as a Hash and the search definition itself should be passed as a block using the Tire DSL .
def search(*args, &block)
          name_or_options = args.pop
          if name_or_options.is_a?(Hash)
            options = name_or_options
            name    = args.pop
          else
            name    = name_or_options
          end
          name    ||= @searches.size
          options ||= {}
          indices   = options.delete(:index) || options.delete(:indices)
          @searches << { :name => name, :search => Tire::Search::Search.new(indices, options, &block) }
        end
def search ( * args , & block ) name_or_options = args . pop if name_or_options . is_a? ( Hash ) options = name_or_options name = args . pop else name = name_or_options end name ||= @searches . size options ||= { } indices = options . delete ( :index ) || options . delete ( :indices ) @searches << { :name => name , :search => Tire :: Search :: Search . new ( indices , options , & block ) } end
Add a search definition to the multi-search request.
Add a search definition to the multi - search request .
args
<not_specific>
block
<not_specific>