And if i build a query similiar to this:
"firstname:whatever OR (lastname:whatever AND (friend_ids:99 OR
privacy:0)) OR description:whatever"

(User with ID 99 is searching for "whatever", privacy = 0 -> privacy
disabled, privacy = 1 -> privacy enabled)


Otherwise i see following options:
- stick with what we have now (lots of LIKE staments, will not scale
as soon as we have more users and more text to search and does not
offer weights, facets and so on)
- use several queries and then merge the results
- filter the results after the are returned by TS and try to get
pagination working. maybe search_for_ids is the way to go here...
pagination would then involve only messing with a list if Integers
- try the named scope thing Alex proposed (and again... get pagination
to work)

Pascal




On Feb 17, 9:11 am, Pat Allan <[email protected]> wrote:
> Oh, misunderstanding on my part.
>
> I'm afraid I can't think of a way to do that using Sphinx... you can  
> only limit the records returned, not the text that is compared against  
> in each record (on a case-by-case basis, that is).
>
> Unless there's other clever minds on this list who can think of a way?
>
> --
> Pat
>
> On 17/02/2009, at 6:37 PM, pascal wrote:
>
>
>
> > Pat
>
> > I had a look at your example but I'm not sure it does excactly what i
> > need....
> > The privacy check should only be applied to the "Lastname" attribute
> > of the user model, not to "description" and "firstname".
>
> > How can i achieve something like that?
>
> > Thanks
>
> > Pascal
>
> >>>>>>> # This will match 0 for public users, and the user id for  
> >>>>>>> private
> >>>>>>> users
> >>>>>>> User.search "whatever", :with => {:user_limit => [0, user.id]}
>
> >>>>>>> Give that a shot.
>
> >>>>>>> Cheers
--~--~---------~--~----~------------~-------~--~----~
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