I have a product table and a variants table
Product - title, description, id
Variant - id, product_id, size_label, qty, price
Product has_many variants
Variant belongs_to product
I have defined my product index like
ThinkingSphinx::Index.define :product, :with => :active_record, delta: true do
indexes title, facet: true
indexes variants.size_label, as: :sizelabel, facet: true
has variants.id, as: :variant_ids
has variants.qty, as: :variant_qty
end
If I have product with 5 variants, eg with size_label S, M, L, XL, XXL then the sizelabel facet is returned as one string "S M L XL XXL"
Am I setting up the index wrong - expecting the variants to be returned as a separate hash (like other facets are)
Using Rails 3.2.19, Sphinx 2.1.9, Thinking Sphinx 3.1.1