Hi Pat, For completeness, here's what worked for me:
* Set ThinkingSphinx.deltas_enabled / update_enabled = true immediately before the define_index block in the model -- setting it in env.rb or [test|spec]_helper.rb doesn't work * Rebuild indices... ;-) It seems that when deltas_enabled is set in environment.rb the classloading (and hence execution of define_index) has already been done, meaning deltas_enabled is _false_ when define_index executes. Since there is specific TS code handling the 'test' env, trouble ensues. It might be possible to put the code into config/initializers, or maybe it depends on position in env.rb... whatever, it now works splendidly. Thanks so much for such an excellent piece of kit. Best regards, Thomas. Thomas Nichols wrote on 2009/09/02 22:39: > Hi Pat, > > Thanks for the suggestion (and apologies for the delay). I've added > those to environments/test.rb but still get the same behaviour. I've > written a tiny test script to load into script/console at > http://gist.github.com/179965 -- works in dev mode, fails in test mode. > > Do I take it that other people have TS delta indexing working fine in > test mode? > > Any pointers would be very welcome, I'm baffled by this one. > > -- Thomas > > > Pat Allan wrote on 2009/08/30 22:21: > >> Hi Thomas >> >> Try setting these settings in your test_helper/spec_helper file: >> >> ThinkingSphinx.deltas_enabled = true >> ThinkingSphinx.updates_enabled = true >> >> Also, you may want: >> >> ThinkingSphinx.suppress_delta_output = true >> >> -- >> Pat >> >> On 29/08/2009, at 4:35 PM, Thomas Nichols wrote: >> >> >> >>> TS works sweetly, using infix_min_length and delta indexes, in both >>> production and development environments. However, in test mode only >>> the >>> main search index works for me. >>> >>> Gist at http://gist.github.com/177501 has details: contact.rb has a >>> define_index (with a dynamically computed "indexes" statement for some >>> dynamically generated fields), the log file shows both dev and test >>> ts:rebuild tasks running ok, then a search on a new record succeeds in >>> dev mode... but fails in test mode. Indev mode, "save!" triggers TS >>> output and a short delay as it reindexes -- but in test mode there's >>> no >>> delay and no output. >>> >>> Setting config.cache_classes does not affect this. Anyone any >>> suggestions I could try? I saw gobigdave was also having problems, >>> possibly in a similar area; does anyone have deltas working in test >>> mode? >>> >>> -- Thomas >>> >>> >>> >>> >>> >>> >> >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
