Sha256: ee88d5139b05d56a262ffb4e989ca64860025318e7dc8b4fc64f9b151f60e2ec
Contents?: true
Size: 589 Bytes
Versions: 17
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true class ThinkingSphinx::Facet attr_reader :name def initialize(name, properties) @name, @properties = name, properties end def filter_type use_field? ? :conditions : :with end def results_from(raw) raw.inject({}) { |hash, row| hash[row[group_column]] = row["sphinx_internal_count"] hash } end private def group_column @properties.any?(&:multi?) ? "sphinx_internal_group" : name end def use_field? @properties.any? { |property| property.type.nil? || property.type == :string } end end
Version data entries
17 entries across 17 versions & 1 rubygems