Skip to content

Instantly share code, notes, and snippets.

@thomasn
Created September 2, 2009 21:23
Show Gist options
  • Save thomasn/179965 to your computer and use it in GitHub Desktop.
Save thomasn/179965 to your computer and use it in GitHub Desktop.
config.cache_classes = false
config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_view.debug_rjs = true
config.action_mailer.raise_delivery_errors = false
### in development mode:
$ script/console
Loading development environment (Rails 2.3.2)
>> require 'tstest'
Sphinx 0.9.9-rc2 (r1785)
Copyright (c) 2001-2009, Andrew Aksyonoff
using config file '/home/thomasn/dev/forgetmenot/forgetmenot/config/development.sphinx.conf'...
WARNING: key 'address' is deprecated in /home/thomasn/dev/forgetmenot/forgetmenot/config/development.sphinx.conf line 7; use 'listen' instead.
WARNING: key 'port' is deprecated in /home/thomasn/dev/forgetmenot/forgetmenot/config/development.sphinx.conf line 8; use 'listen' instead.
indexing index 'contact_delta'...
collected 2 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 2 docs, 25 bytes
total 0.184 sec, 135 bytes/sec, 10.85 docs/sec
total 14 reads, 0.000 sec, 4.6 kb/call avg, 0.0 msec/call avg
total 12 writes, 0.010 sec, 0.3 kb/call avg, 0.9 msec/call avg
rotating indices: succesfully sent SIGHUP to searchd (pid=5607).
found it with search of delta index
=> []
### in test mode:
$ RAILS_ENV=test script/console
Loading test environment (Rails 2.3.2)
>> require 'tstest'
delta search failed
=> true
config.cache_classes = true
config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.delivery_method = :test
ThinkingSphinx.deltas_enabled = true
ThinkingSphinx.updates_enabled = true
ThinkingSphinx.suppress_delta_output = true
c = Contact.new :first_name => 'Joan', :last_name => 'OfArc'
puts "fail 001" unless 'OfArc' == c.last_name
c.save!
c = Contact.find_by_last_name('OfArc')
puts "fail 002" unless 'OfArc' == c.last_name
if Contact.search('OfArc').size == 1
puts "found it with search of delta index"
else
puts "delta search failed"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment