acts as ferret vs mysql full text search

if you’ve got massive amounts of data and need fast
search results then ferret and acts_as_ferret are definitly an option.
It fits all of your needs - range queries, sorting etc.

if
things are performant on mysql and you are able to rely on myisam
instead of innodb (on which there is no fulltext ability) then you are
fine with mysql standalone.

Cheers,
Jan

Is there a way to do simple joins in ferret, like

   "search 'foo' in the posts written by user wth ID 37"

or

   "serach 'foo' in the posts written by users who are administrators"

?

> if you've got massive amounts of data and need fast search results
> then ferret and acts_as_ferret are definitly an option. It fits all
> of your needs - range queries, sorting etc.
>
> if things are performant on mysql and you are able to rely on
> myisam instead of innodb (on which there is no fulltext ability)
> then you are fine with mysql standalone.

Is there a way to do simple joins in ferret, like

   "search 'foo' in the posts written by user wth ID 37"

or

   "serach 'foo' in the posts written by users who are administrators"

?

Hi Xavier,

This is kind of possible but you have to remember that Ferret is not a
database (yet) so things work a little differently. Ferret is
basically a large array of *documents*, which are basically Hashes of
text fields. All fields are stored as text (although you can sort
results by integer fields and do range queries on integers). So if you
want to do queries like those specified above you need to put all the
values you need into a single document. So for your first example:

   "search 'foo' in the posts written by user wth ID 37"

You need to store the user ID in the document along with the post. If
there are multiple user IDs per post then you can store an array of
ids. Your query would then look like this:

    "post:foo user_id:37"

Your second example would look like this:

    "post:foo user_role:administrator"

and you would need to store the user_role in the document as well.

I hope this makes sense. I'm currently in the initial stages of
building an object database based on Ferret so eventually you'll be
able to do joins[1] and all those other good things you can do in
databases and maybe even do away with your current database.

Cheers,
Dave

[1] well, technically in an object database they are not really joins
but nevermind.