OK, got it. The various Archive subclasses are stored as an extension
inside core Radiant. The archive extension is loading before sphinx-
search, so those Page subclasses are loaded before Thinking Sphinx is
injected into their base class. At that point it's too late for any
already-loaded subclasses to inherit the behavior.
The workaround: load sphinx-search before archives. In config/
environment.rb:
config.extensions = [:sphinx_search, :all]
I'll update the extension docs to reflect this. Let me know if you're
still having trouble with it.
Best,
Josh
On Jan 7, 12:28 am, John Polling <[email protected]>
wrote:
> I'm also using plenty of virtual pages.
>
> On Jan 6, 10:11 pm, Christian Aust <[email protected]>
> wrote:
>
>
>
> > Very same setup of gems here. Still, it doesn't work.
>
> > To be sure, I set up a fresh instance of Ubuntu 9.10, installed ruby
> > and rubygems and mysql and sphinx and rails and gemcutter and ...
>
> > [you get it, I found it surprisingly hard to install radiant on a
> > fresh machine, took me 10 minutes for Ubuntu and 60 minutes to figure
> > out the gem dependency errors]
>
> > ... in the end, I got the very same error that I described above.
> > "rake thinking_sphinx:rebuild --trace" doesn't even run. Same error
> > message as described in my gist.
>
> > I assume it has something to do with "virtual" pages. I see that when
> > I have eg Archive pages involved in the site, that's why I chose the
> > template including the blog and archives. Regards,
>
> > Christian
>
> > On 6 Jan., 15:43, Josh French <[email protected]> wrote:
>
> > > Something is amiss, your gist works just fine for me. Let's be sure
> > > everyone's on the same page -- I'm running:
>
> > > Radiant 0.8.1
> > > Sphinx 0.9.8.1
> > > Thinking Sphinx 1.3.14
> > > Will Paginate 2.3.11 (From gemcutter, although the github mislav-
> > > version also worked for me)
>
> > > Does that differ from your environment?
>
> > > j
>
> > > On Jan 5, 3:43 am, Christian Aust <[email protected]>
> > > wrote:
>
> > > > Hi Pat & Josh,
>
> > > > that's fairly easy to reproduce, detailled steps are on gist:
>
> > > >http://gist.github.com/269247
>
> > > > Even the rake task of setting up TS crashes. Any idea? Kind regards,
>
> > > > Christian
>
> > > > On 3 Jan., 05:00, Pat Allan <[email protected]> wrote:
>
> > > > > Hi Christian
>
> > > > > Are you able to put together a sample app that reproduces this issue?
> > > > > I'm not sure if the fault is in Thinking Sphinx, Rails, or Radiant.
> > > > > Your extension seems simple enough, and isn't doing anything complex,
> > > > > so I very much doubt that's at fault.
>
> > > > > If you can do this, feel free to send it to me off-list (or if you
> > > > > put it into GitHub, just give me read access).
>
> > > > > Cheers
>
> > > > > --
> > > > > Pat
>
> > > > > On 02/01/2010, at 7:29 PM, Christian Aust wrote:
>
> > > > > > Hi Pat,
>
> > > > > > there's no too much code in that extension, basically it goes like
> > > > > > this:
>
> > > > > > When the extension loads, it executes this:
>
> > > > > >> def activate
> > > > > >> Page.send(:include, SphinxSearch::PageExtensions)
> > > > > >> # [...]
> > > > > >> end
>
> > > > > > The PageExtensions look like this:
>
> > > > > >> def self.included(base)
> > > > > >> base.define_index do
> > > > > >> set_property :delta => true, :group_concat_max_len =>
> > > > > >> 8.kilobytes
> > > > > >> set_property :field_weights => { 'title' => 100 }
> > > > > >> indexes :title, parts.content
> > > > > >> indexes :tools, :roles, :duration, :customer
> > > > > >> has :updated_at, :status_id
> > > > > >> has :searchable, :type => :boolean
> > > > > >> end
> > > > > >> end
>
> > > > > > The errors occur with instances of classes that are a subclass of
> > > > > > Page, as if those instances of certain subclasses hadn't been
> > > > > > initialized properly. Is there something wrong with the way how
> > > > > > classes are extended by the code above? Regards,
>
> > > > > > Christian
>
> > > > > > On 2 Jan., 07:27, Pat Allan <[email protected]> wrote:
> > > > > >> Hi Christian
>
> > > > > >> I think that might be the Radiant extension that's having problems
> > > > > >> - though I'm not certain.
>
> > > > > >> sphinx_indexes is set when define_index is called - and so, this
> > > > > >> should happen when the model is loaded. The fact that it's no
> > > > > >> longer set suggests that it could be tied to cache_classes or
> > > > > >> something like that.
>
> > > > > >> --
> > > > > >> Pat
>
> > > > > >> On 02/01/2010, at 8:20 AM, Christian Aust wrote:
>
> > > > > >>> Hi all,
>
> > > > > >>> I'm using TS with Radiant, which causes me some trouble currently.
> > > > > >>> Actually I'm not sure if this is originally a problem of TS, or if
> > > > > >>> it's the radiant extension causing the error, but let me explain:
>
> > > > > >>> I've upgraded the TS gem to 1.3.14, and my application started to
> > > > > >>> spit
> > > > > >>> out errors every now and then. Errors occur when I try to edit a
> > > > > >>> page
> > > > > >>> that's a subclass of the ActiveRecord base class "Page", not a
> > > > > >>> page
> > > > > >>> itself. There are two errors that I spotted so far:
>
> > > > > >>>> NoMethodError (undefined method `any?' for nil:NilClass):
> > > > > >>>> /usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/thinking_sphinx/acti
> > > > > >>>> ve_record/delta.rb:50:in `indexed_data_changed?'
> > > > > >>>> /usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/thinking_sphinx/acti
> > > > > >>>> ve_record/delta.rb:46:in `should_toggle_delta?'
> > > > > >>>> /usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/thinking_sphinx/acti
> > > > > >>>> ve_record/delta.rb:35:in `toggle_delta'
> > > > > >>>> vendor/extensions/reorder/lib/reorder/pages_controller_extensions.rb:7:in
> > > > > >>>> `send'
> > > > > >>>> vendor/extensions/reorder/lib/reorder/pages_controller_extensions.rb:7:in
> > > > > >>>> `move_lower'
> > > > > >>>> radiant (0.8.1)
> > > > > >>>> vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:19:in
> > > > > >>>> `process'
>
> > > > > >>> Theres another NoMethodError in active_record.rb:193 where the
> > > > > >>> code
> > > > > >>> tries to add an index to self.sphinx_indexes which is nil
> > > > > >>> sometimes,
> > > > > >>> which is easy to work around: I've added "unless
> > > > > >>> self.sphinx_indexes.nil?" at the end of the line and was fine so
> > > > > >>> far.
>
> > > > > >>> Can somebody help me to understand whether this is something TS-
> > > > > >>> related or should I check the code of the Radiant extension? Kind
> > > > > >>> regards,
>
> > > > > >>> Christian
>
> > > > > >>> --
>
> > > > > >>> 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
> > > > > >>> athttp://groups.google.com/group/thinking-sphinx?hl=en.
>
> > > > > > --
>
> > > > > > 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
> > > > > > athttp://groups.google.com/group/thinking-sphinx?hl=en.
--
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.