Thank you Pat. In addition, I found out you have to include the id
column in the select or you get a bunch of nils back.

So, Model.search 'Anthony', :select => 'id, firstname, lastname'

Thanks again,
Anthony

On Sep 6, 7:37 pm, Pat Allan <[email protected]> wrote:
> Ah, I see. The :select option will work in a search in the same way it does 
> for a normal AR request. So:
>
>   Model.search 'Anthony', :select => 'firstname, lastname'
>
> --
> Pat
>
> On 07/09/2011, at 10:29 AM, alassiter wrote:
>
>
>
>
>
>
>
> > I want to search all  fields that I have indexed: firstname, lastname,
> > email, phone, city, state, etc...
>
> > when I perform the search, perhaps it returns 10 results. Right now,
> > all 10 records have firstname, lastname, email, phone, city, state,
> > etc....
>
> > I only want the firstname and lastname returned. With ActiveRecord, I
> > can do Model.all(:select => "firstname, lastname") and all I get are
> > the firstname and lastname.
>
> > I'm returning the results via xml and don't need to return everything.
>
> > Does that clarify it a bit? Sorry, i'm not sure how to ask this.
>
> > -Anthony
>
> > On Sep 6, 6:45 pm, Pat Allan <[email protected]> wrote:
> >> Hi Anthony
>
> >> What do you mean by only giving you first name and last name? Do you want 
> >> to search on only those two fields? If so, something like this should do 
> >> the trick:
>
> >>   Model.search "@(first_name,last_name) Anthony", :match_mode => :extended
>
> >> But otherwise, I'm not sure what you mean.
>
> >> --
> >> Pat
>
> >> On 07/09/2011, at 8:14 AM, alassiter wrote:
>
> >>> I have indexing turned on for several fields b/c I want to be able to
> >>> search them. The result returns lets say, 5 records. Each records
> >>> contains all the fields in the model. I only want first_name and
> >>> last_name.
>
> >>> How do I tell ThinkingSphinx to only give me first_name and last_name?
>
> >>> Thank you
>
> >>> --
> >>> 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 
> >>> athttp://groups.google.com/group/thinking-sphinx?hl=en.
>
> > --
> > 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 
> > athttp://groups.google.com/group/thinking-sphinx?hl=en.

-- 
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