Class: ThinkingSphinx::Facet
- Inherits:
-
Object
- Object
- ThinkingSphinx::Facet
- Defined in:
- lib/thinking_sphinx/facet.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #filter_type ⇒ Object
-
#initialize(name, properties) ⇒ Facet
constructor
A new instance of Facet.
- #results_from(raw) ⇒ Object
Constructor Details
#initialize(name, properties) ⇒ Facet
Returns a new instance of Facet.
6 7 8 |
# File 'lib/thinking_sphinx/facet.rb', line 6 def initialize(name, properties) @name, @properties = name, properties end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/thinking_sphinx/facet.rb', line 4 def name @name end |
Instance Method Details
#filter_type ⇒ Object
10 11 12 |
# File 'lib/thinking_sphinx/facet.rb', line 10 def filter_type use_field? ? :conditions : :with end |
#results_from(raw) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/thinking_sphinx/facet.rb', line 14 def results_from(raw) raw.inject({}) { |hash, row| hash[row[group_column]] = row["sphinx_internal_count"] hash } end |