Christopher's got it exactly - but also, there's already an attribute, 
generally used internally by Thinking Sphinx called sphinx_internal_id - which 
is the primary key of the model. So you can just use that in your filters, and 
you'll be good to go.

Cheers

-- 
Pat

On 4 Apr 2014, at 8:20 am, Christopher Foy <[email protected]> wrote:

> You can add an attribute to your index definition for the id field as 
> described here taking care to alias a reserved name like id 
> http://pat.github.io/thinking-sphinx/indexing.html#attributes
> 
> Then you can use an attribute filter as described 
> http://pat.github.io/thinking-sphinx/searching.html#filters
> 
> So you'd have: Title.search "search_term", with: {title_id: [1,3,5,6,7]}
> 
> On Thursday, 3 April 2014 10:13:50 UTC-4, Walter Davis wrote:
> I am using TS2 for this, so I can't use the new TS3 query goodness. If I were 
> doing this in MySQL, I would probably do something like this: 
> 
>         SELECT * FROM titles WHERE `column` like '%match-term%' AND id 
> IN(1,3,5,6,7); 
> 
> Is there a way to pass that sort of thing (the id IN() part, not the match 
> term) into a search as a filter? 
> 
> Thanks in advance, 
> 
> Walter
> 
> -- 
> 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