Sha256: 343ec624078968967c23e06748f0d69ff610b035f84a34a247a2724e3918df41

Contents?: true

Size: 721 Bytes

Versions: 8

Compression:

Stored size: 721 Bytes

Contents

module ThinkingSphinx::SphinxQL
  mattr_accessor :weight, :group_by, :count

  def self.functions!
    self.weight   = {:select => 'weight()', :column => 'weight()'}
    self.group_by = {
      :select => 'groupby() AS sphinx_internal_group',
      :column => 'sphinx_internal_group'
    }
    self.count    = {
      :select => 'id AS sphinx_document_id, count(DISTINCT sphinx_document_id) AS sphinx_internal_count',
      :column => 'sphinx_internal_count'
    }
  end

  def self.variables!
    self.weight   = {:select => '@weight',  :column => '@weight'}
    self.group_by = {:select => '@groupby', :column => '@groupby'}
    self.count    = {:select => '@count',   :column => '@count'}
  end

  self.functions!
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/sphinxql.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/sphinxql.rb