The first thing to note is that string attributes (as opposed to fields) can't 
be used in filters, and you'd want single string values for facets (not 
everything together in a single string), so I don't think your single string 
attribute suggestion will work out.

An alternative is search on the items *in* the schedule, get the user ids from 
that set, and then search across users *not* in that collection of user ids. It 
does mean two queries instead of one, but it's a little more obvious and a 
little less complex.

-- 
Pat

On 25/09/2013, at 12:30 AM, deneuxa <[email protected]> wrote:

> Hello guys,
> do you have any idea for this question ?
> 
> http://stackoverflow.com/questions/18984133/database-design-with-thinking-sphinx-week-schedule
> 
> 
> 
> COPY ABOVE:
> 
> 
> I need to implement a Week availability/schedule like this one on my App. 
> Each User has his own week availabities :
> 
> 
> 
> I need to query my database and be able to find users who are available on 
> specificics slots. I tought I could implement 7x7 = 49 booleans attributes 
> directly on my model , but I feel that it is not a very clean solution!
> 
> Other problem I'm facing : I wish to use Thinking_sphinx gem to index and 
> query this content (and others attributes too) with facets navigation. There 
> was a limit of facets numbers previsoulsy I don't know if it is still true.
> 
> Do you think it's better to use 49 boolean attributes or 1 single string 
> attribute containing for exemple "Mo1 Mo2 Mo3 ..... Th1 Th6 Th7 Fr1 .....Su7" 
> ?
> 
> Or any other solution ?
> 
> 
> -- 
> 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/groups/opt_out.

-- 
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/groups/opt_out.

Reply via email to