I don't think anything like this is possible, I'm afraid. Sphinx faceting is 
done by grouping on attributes, so you'd need each facet to be defined as an 
attribute, which means you need to know what they are when configuring Sphinx.

Also, Sphinx has no concept of a hash/dictionary data type, so for a Product, 
you couldn't have option types have option values, let alone distinguish 
between them on a variant level. That said, you could search on OptionType 
instead... but you still have the above issue to deal with.

For reference, it's worth noting that Sphinx has an inbuilt FACET function from 
2.2.3 (2.2.x releases are considered betas):
http://sphinxsearch.com/blog/2014/05/22/the-facet-feature/
But that doesn't address the issue I've covered.

One thing that *might* help - it'd require some investigation, though - is the 
JSON support in Sphinx since version 2.1.1-beta:
http://sphinxsearch.com/blog/2013/08/08/full-json-support-in-trunk/
I've not really played with it, but maybe that would allow the types of queries 
you need to group by specific values, if a Product or Variant's option types 
and option values are stored as JSON in Sphinx? This is probably the only path 
worth investigating, but I can't guarantee if it'll work or not.

-- 
Pat

On 21 Jul 2014, at 2:39 pm, Abhishek jain <[email protected]> wrote:

> Hi,
> 
> In my project I need a functionality based on dynamic faceting. 
> 
> Something like:
> 
> Lets say we have 4 models product, variants, option types and option values
> 
> OptionType has_many => option_values
> Variant has_many => option_values
> Product has_many => option_types
> Product has_many => variants
> 
> I need to facet option type having its facet values as option_values
> And option values are linked with product objects.
> 
> Example.
> 
> Color (Option Type)
>   -> Red (Option Value)
>   -> Green (Option Value)
>   -> Blue (Option Value)
> 
> Product has option type Color and variant has option value as Red.
> Hence faceted value should be
> 
> Color
> - Red (1)
> 
> Now, when I add another option type, lets say Size.
> with option values.
> Size (Option Type)
>   -> L (Option Value)
>   -> XL (Option Value)
>   -> XXL (Option Value)
> 
> And link Size with product and XL with one of the variant, then
> 
> Result should be something like,
> 
> Color
> - Red(1)
> - Green(0)
> - Blue(0)
> 
> Size
> - L (0)
> - XL (1)
> - XXL (0)
> 
> Is it possible to do this with ThinkingSphinx? 
> 
> 
> -- 
> 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 http://groups.google.com/group/thinking-sphinx.
> For more options, visit 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 http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to