Hi Miha

If you want all facets sorted the same way, then you can use the :order option 
and sort either by sphinx_internal_group (the facet key values) or 
sphinx_internal_count (the number of results for a facet key) ASC/DESC.

  Product.is_product_visible.is_created.facets @keyword_string, :order => 
‘sphinx_internal_group ASC’, :with => ts_filters

However, if you only want some facets sorted a specific way, then I’m afraid 
you’re best served by assigning the sorted values (as you’re computing in your 
example) as new objects, instead of trying to modify the TS facet search 
results.

Cheers

— 
Pat

> On 18 Feb 2016, at 10:15 PM, Treeninja <[email protected]> wrote:
> 
> Hi!
> 
> I've migrated to TS 3.1.4 and have problem with facets sorting.
> 
> I am using this:
> 
>     @facets = Product.is_product_visible.is_created.facets @keyword_string, 
> :order => (order), :with => ts_filters
>     @facets[:industry_id] = Hash[@facets[:industry_id].sort]
>     @facets[:country_id]= Hash[@facets[:country_id].sort]
> 
> Error is: 
> 
> undefined method `[]=' for #<ThinkingSphinx::FacetSearch:0x0000000d879ee0>
> 
> How can i properly sort facets?
> 
> Thanks.
> 
> Best regards, Miha
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/thinking-sphinx 
> <https://groups.google.com/group/thinking-sphinx>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.


-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to