I'm trying to use Thinking Sphinx with my Can Can solution for authorization.
I found this answer helpful Cancan Thinking Sphinx current_ability Questions, but was wondering if there might be a way to accomplish this with facets.
So I have projects, where there is a column called privacy
which is a bool. If a project is private then there is an index for collaborator_ids
, which is a list of all of the users that can view the project.
I was wondering if there is a way to form a query using facets to return all projects that are either public OR private and the user's id is in the collaborator_ids
.
Another approach I'm considering is formulating an extended query in my controller to check for these fields. http://sphinxsearch.com/docs/current.html#extended-syntax