Sha256: 574836f48c082336dcc4cc0f3d36fcfa54667e2caf5975972a34753d51536b00

Contents?: true

Size: 393 Bytes

Versions: 17

Compression:

Stored size: 393 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Search::BatchInquirer
  def initialize(&block)
    @queries = []

    yield self if block_given?
  end

  def append_query(query)
    @queries << query
  end

  def results
    @results ||= begin
      @queries.freeze

      ThinkingSphinx::Connection.take do |connection|
        connection.query_all *@queries
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/search/batch_inquirer.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/search/batch_inquirer.rb