On Feb 10, 11:04 am, leei <[email protected]> wrote:
> I have two questions about using facets:
>
> 1. How can I get TS to return the facet counts in descending order of
> count?  Some of my facets may have many more values than the 50 or 100
> I want to show, but when I ask for a limit it seems to return the
> values in some arbitrary order and so I may miss some of the highest
> prevalence facet values.

Answering my own question: one way is to add the :group_clause =>
"@count desc" option to the facet query!  I've branched the repo and
patched my copy so that :order => :count is converted to this if there
is a :group_by option. In this case the shortcut "Asset.facets :order
=> :count" does the right thing.

> 2. Is there any way to get MVA facets to work? When I specify an MVA
> attribute as a facet, it treats the "set of values" as the unique
> value that gets grouped and counted.  Is there a way to treat the
> individual values in the MVA as the values to be grouped?  E.g. I have
> "has taggings.tag_id, :as => :tag_ids" and this works great with
> filtering (i.e. I can filter on :with_all => {:tag_ids => [2,4]} to
> get coincident tags), but the facet index wants to count complete sets
> of tag_ids instead of each individual tag_id.

This seems to be a popular issue now.  I'm working on it too.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to