Bundler could not find compatible versions for gem "activesupport":In Gemfile:picky-client (= 4.6.2) ruby depends onactivesupport (~> 3) rubyrails (>= 0) ruby depends onactivesupport (4.0.0.beta)
By the way, I've got "extend Picky::Client::ActiveRecord.new(...)" in my Rails model, but I'm confused as to how to set up the Sinatra server. Even though I have the Rails model set up to update the Index after updates and deletes, I still need to set up the Index first in Sinatra, which has no knowledge of my Rails app.
What should the "source" be?
Or is there some way of telling the Sinatra server to set up an index, search, and route remotely?
There are examples of some of this on the web, but they're all wildly different and mostly seem to be out of date.
It seems as if the "spermy operator" wasn't consistent. Thanks for the info. I updated the latest version (4.6.3) to use ">= 3.0".
By the way, I've got "extend Picky::Client::ActiveRecord.new(...)" in my Rails model, but I'm confused as to how to set up the Sinatra server. Even though I have the Rails model set up to update the Index after updates and deletes, I still need to set up the Index first in Sinatra, which has no knowledge of my Rails app.I'm not perfectly sure what your setup is. You have a Rails app, and a separate Picky/Sinatra server?
class SearchEngine < Sinatra::Applicationsessions_index = Picky::Index.new(:sessions) doendsessions = Picky::Search.new(sessions_index)get '/sessions' doresults = sessions.search(params[:query], params[:ids] || 20, params[:offset] || 0)AppLogger.info resultsresults.to_jsonendend
SearchServer = Picky::Client.new(:host => 'localhost',:port => 8080,:path => '/sessions')
On Sunday, August 12, 2012 1:11:02 AM UTC-4, Picky / Florian Hanke wrote:It seems as if the "spermy operator" wasn't consistent. Thanks for the info. I updated the latest version (4.6.3) to use ">= 3.0".Works great. Thanks!
By the way, I've got "extend Picky::Client::ActiveRecord.new(...)" in my Rails model, but I'm confused as to how to set up the Sinatra server. Even though I have the Rails model set up to update the Index after updates and deletes, I still need to set up the Index first in Sinatra, which has no knowledge of my Rails app.I'm not perfectly sure what your setup is. You have a Rails app, and a separate Picky/Sinatra server?Yes. Here's what I've got so far. I have a Sinatra server running Picky:class SearchEngine < Sinatra::Applicationsessions_index = Picky::Index.new(:sessions) doendsessions = Picky::Search.new(sessions_index)get '/sessions' doresults = sessions.search(params[:query], params[:ids] || 20, params[:offset] || 0)AppLogger.info resultsresults.to_jsonendendI didn't use a source here, so I'm not sure how to populate the Index initially when I run the Sinatra application. I suppose I can connect to the SQL database and add all of the rows to the Index when I start the Picky server. But then I'll lose the ability to use transient attributes from my Rails models and it will make it somewhat difficult to make changes to things like joined columns in the future.
I also can't add any categories, or the server fails to start because the index is missing:~/.rvm/gems/ruby-1.9.3-p194/gems/picky-4.6.3/lib/picky/backends/memory/json.rb:20:in `initialize': No such file or directory - ~/session_search_server/index/development/sessions/counter_party_exact_inverted.memory.json (Errno::ENOENT)I get the same thing when I try to run rake index.On the Rails side, I can initialize a Picky client:SearchServer = Picky::Client.new(:host => 'localhost',:port => 8080,:path => '/sessions')Then in my Rails model, I can use the Client to search. But it's just the initial Index population (and setting up categories to draw from my model) that I'm having trouble doing.