Is there a way to do searching of FULLTEXT indexes with MATCH with the ActiveRecord find or do I just use the find_by_sql method?
In java, I''d recommend using lucene so that you can shift the load to the web server instead of the database. I''ve heard talk about a ruby lucene port, but I don''t think it''s ready yet. Are you planning on using MySQL''s FULLTEXT searching? Does it support InnoDB yet? - Philip On 4/19/05, Henry Maddocks <henryj-wUU9E3n5/m4qAMOr+u8IRA@public.gmane.org> wrote:> Is there a way to do searching of FULLTEXT indexes with MATCH with the > ActiveRecord find or do I just use the find_by_sql method? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I haven''t seen an official method. If there is, I''d love to be enlightened. I''m using find_by_sql. --Scott On 4/19/05, Philip Gatt <gattster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In java, I''d recommend using lucene so that you can shift the load to > the web server instead of the database. > > I''ve heard talk about a ruby lucene port, but I don''t think it''s ready yet. > > Are you planning on using MySQL''s FULLTEXT searching? Does it support > InnoDB yet? > > - Philip > > > On 4/19/05, Henry Maddocks <henryj-wUU9E3n5/m4qAMOr+u8IRA@public.gmane.org> wrote: > > Is there a way to do searching of FULLTEXT indexes with MATCH with the > > ActiveRecord find or do I just use the find_by_sql method? > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- --Scott
I would just use "find_by_sql", alternatively, if you don''t need the score in your result set, then you can just use the MATCH statement in your conditions for any call to ''find'', ie: Posts.find( :all, :conditions=>["MATCH (text) AGAINST (?)", search_term]) At least I think that''s the syntax with the new version of rails, double check it ;) For adding quick flexible search support to a database app, MySQL''s fulltext search is very handy. PostgreSql also has some good fulltext search support from what I''ve seen. .adam sanderson _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks, that''s exactly what I was after. On 20/04/2005, at 5:37 AM, Adam Sanderson wrote:> I would just use "find_by_sql", alternatively, if you don''t need the > score in your result set, then you can just use the MATCH statement in > your conditions for any call to ''find'', ie: > > Posts.find( :all, :conditions=>["MATCH (text) AGAINST (?)", > search_term]) > > At least I think that''s the syntax with the new version of rails, > double check it ;)That took me a bit by surprise. I went to the docs and thought, hang on, I''m sure these aren''t the methods I was looking at yesterday:) Henry