How to Get Searchlogic to Work with Rails 3

How Do I get searchlogic to work with rails 3?

There's the railsdog's searchlogic fork on github that supports Rails 3.

You can add it to your Gemfile like this:

gem 'rd_searchlogic', :require => 'searchlogic', :git => 'git://github.com/railsdog/searchlogic.git'

Will searchlogic work with Rails 3?

Metawhere - http://metautonomo.us/projects/metawhere/
looks like a promising alternative.
ps: discovered metawhere through rubyflow.com.
MetaSearch (http://metautonomo.us/2010/03/07/metasearch-object-based-searching-for-rails-3/)
by the same author is actually closer to Searchlogic.

Ruby on Rails: 2.3.8: How do I get searchlogic to work with bundler?

As it turns out, the version(s) of searchlogic that I can use don't work with bundler, so I just kept this in my environment.rb:

config.gem "searchlogic", :version => "whatever"

rails 3 meta_search usage

The methods are attributes to be set in a FormBuilder. As such, you'll want to call user_name_equals = "Bob", not user_name_equals("Bob"). Also, they'll be on a search instance, not the model itself.

@search = User.search(:user_name_eq => "Bob")

If you're looking for something to use in day to day query construction, try MetaWhere instead. http://metautonomo.us/projects/metawhere

I have a little problem with Searchlogic in Rails 3

I'm not actually sure Searchlogic works with Rails 3. I think the current gem you want to use is MetaSearch:

https://github.com/ernie/meta_search

I think the syntax is almost exactly the same so anything that you've setup in Searchlogic will carry over to Metasearch.

Hope this helps!

how would I translate this from searchlogic to metwhere in Rails 3?

It seems that metawhere doesn't have != operator it was added in sqeel so here is a possible workaround

Todo.where( { :contact_id => self.id} ).order( :original_date.asc ).where( '"todos"."done_date" NOT NULL' ).first


Related Topics



Leave a reply



Submit