Hey everybody,
I really do like ts plugin and I am trying to work it out how to set
up my app to index my posts as soon as they are posted.
DEPLOY.rb
task :after_update_code, :roles => [:app, :db] do
# link database configuration
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/
config/database.yml"
run "cd #{current_path} && rake ts:stop"
end
desc "Stop the webserver with the old release and start the server for
the new release"
namespace :deploy do
task :restart, :roles => :app do
run "cd #{current_path} && rake ts:index && rake ts:start"
run "/usr/local/etc/rc.d/mongrel_cluster restart"
end
end
-----------------------------------------------------------
POST model
define_index do
# fields
indexes title, :as => :post_title, :sortable => true
indexes body, :as => :post_body
indexes annotation, :as => :post_annotation
indexes user.username, :as => :author, :sortable => true
# attributes
has user_id
has editorial, :as => :editorial
has for_public, :as => :public
set_property :delta => true
#set_property :delta => {:field => :updated_on, :threshold =>
1.day}
end
---------------------------------------------------------
I've added delta to my post table in DB.
all works fine, but all my new posts are searchable after when I
deploy my app (ts:index), but I would like to be indexed straightaway
after they were created.
Are there any bits and pieces I am missing? Any help would be
appreciated. Thank you very much.
Cheers,
Pete
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---