I'm assuming you're passing in a custom :per_page option - because otherwise 
you wouldn't get 125 results in your first example. How high is this value? 
It's possible there's enough other matches for other classes, that only 19 
article results get through to your global search.

All searches look at all fields, unless you're using :conditions (or manually 
constructing an extended query string), so the associated tags won't be the 
problem.

-- 
Pat

On 29/12/2009, at 3:53 AM, rpheath wrote:

> I'm using ThinkingSphinx.search (global search) to search across
> multiple models. For simplicity, I'll refer to two models: Article and
> Comment.
> 
> I'm wrapping the ThinkingSphinx search into a Search model that groups
> the results into an ordered hash so I can then pull out the results
> for whichever model I'm looking for (useful for a multi-result search
> page). So it's something like this:
> 
> <pre>
> class Search
>  def self.grouped(keywords)
>    ThinkingSphinx.search(keywords).group_by { |kind|
> kind.class.to_s.underscore }
>  end
> end
> </pre>
> 
> So on the multi-result page I'm only showing the top 5 of each model,
> with a link to "see all" that shows the full results page. The problem
> is, the results are different for global search vs. model search. For
> example:
> 
> <pre>
>>> Article.search('morgantown').size
>>> # => 125
>>> Search.grouped('morgantown')["article"].size
>>> # => 19
> </pre>
> 
> My only thought is I'm also indexing the associated tags for the
> Article model, and maybe the global search doesn't search across the
> tags (associated indexes) as well?
> 
> Any help would be greatly appreciated!
> 
> --
> 
> 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.
> 
> 

--

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