Hi Peter
Currently, Thinking Sphinx doesn't support spell-checking - it's not a
Sphinx feature, although I can see how it would be useful. I've had
someone submit a patch for aspell support, closely modeled on how
Ultrasphinx did it, but at this point in time it's not a high
priority. The ideal solution is to allow for it, but make sure it's
unobtrusive (so if aspell/raspell isn't installed, everything's still
fine - which is probably how the patch works anyway, but just wanted
to be explicit about this).
As for concatenation, Thinking Sphinx does this very simply:
indexes comments.body, :as => :comments
If you wanted to have those conditions wrapped in, I'd recommend
making a separate association, say, active comments:
has_many :active_comments, :class_name => "Comment", :conditions =>
"approved = 't' AND spam = 'f'"
And then have the following field declaration:
indexes active_comments.body, :as => :comments
As for searching across models, you can do that simply as follows:
ThinkingSphinx::Search.search "query", :classes => [Post, User]
Hope this helps - and sorry for the delay in getting back to you.
Cheers
--
Pat
On 27/03/2009, at 5:57 AM, Peter Akkies wrote:
>
> Hi all,
>
> I'm converting my website's search to use Thinking Sphinx instead of
> the currently-used Ultrasphinx. In the process, I have bumped into a
> few problems.
>
> First, I would like to know whether Thinking Sphinx supports the sort
> of spell check that Ultrasphinx does. When searching for "abotion",
> for instance, it will tell you "Did you mean 'abortion'?" I haven't
> been able to find anything like that for TS.
>
> Second, Ultrasphinx' 'is_indexed' method allows me to concatenate:
>
> :concatenate => [
> { :association_name => 'comments',
> :field => 'body',
> :conditions => "approved = 't' AND spam = 'f'",
> :as => 'comments' }
> ]
>
> How can I emulate this behavior with TS's 'indexes'?
>
> Third, can I use :classes to search over multiple models? If so, could
> you give me an example of the usage?
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---