Thanks, I forgot that I had locked my version to 3.1.x in my gemfile when I tried to update the gem, so I hadn't noticed that I wasn't on the latest. I feel a bit silly now. I'm now getting a different error relating to my foreign keys (which are also uuid) not mapping to a valid sphinx type.
Is there a way around this besides adding additional fake foreign keys to go with my fake primary keys and putting those on every model I need sphinx to be aware of? Would there even be a way to configure thinking sphinx so that it tried to find the associated records through those instead? Unfortunately I genuinely do need UUID keys for this app. ~ Melody On Tuesday, July 18, 2017 at 9:11:04 PM UTC-4, Pat Allan wrote: > > Hi Melody, > > There was a couple of commits related to fixing alternative primary keys > that are part of v3.3.0 - I realise if you’re not familiar with this gem or > Sphinx it could be daunting, but I’d recommend upgrading if at all possible. > > The release notes for v3.2.0 and v3.3.0 (the only releases since v3.1.4) > cover off notable changes - I’d say there’s a good chance you won’t hit any > issues though: > https://github.com/pat/thinking-sphinx/releases/tag/v3.2.0 > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fpat%2Fthinking-sphinx%2Freleases%2Ftag%2Fv3.2.0&sa=D&sntz=1&usg=AFQjCNHh69DuVoiXcTHiNlQYsZTDWlq_TA> > https://github.com/pat/thinking-sphinx/releases/tag/v3.3.0 > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fpat%2Fthinking-sphinx%2Freleases%2Ftag%2Fv3.3.0&sa=D&sntz=1&usg=AFQjCNGTQohrWlNsNkBgQ_IFFcGiTo8UzQ> > > If the error (or something like it) is still happening on v3.3.0, do let > me know! > > Cheers, > > — > Pat > > On 19 Jul 2017, at 8:10 am, Melody B <[email protected] <javascript:>> > wrote: > > I'm getting an error on configure: > > Generating configuration to ~/myapp/config/development.sphinx.conf > rake aborted! > NoMethodError: undefined method `<<' for nil:NilClass > ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:96:in > > `block in append_presenter_to_attribute_array' > ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:93:in > > `each' > ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:93:in > > `append_presenter_to_attribute_array' > ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:131:in > > `prepare_for_render' > ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thinking-sphinx-3.1.4/lib/thinking_sphinx/active_record/sql_source.rb:65:in > > `render' > > > I have a few weird things going on in my setup that are (probably?) having > an impact. > > 1. My database is postgres has uuid primary keys > 2. I defined a custom field that generates a bigint in a before_create > callback called secondary_id -- this seemed like the best way to > provide sphinx with something it could index on but if this is the wrong > way to go about keeping my uuid primary keys i'm open to alternative > suggestions > 3. I set secondary_id as the primary key for sphinx in the index > definition with the following code: > 1. ThinkingSphinx::Index.define :answer, with: :active_record, > primary_key: :proxy_id do ... end > > I'm honestly not sure what's going on here -- I tried poking around in the > code to sort out why this was happening and I tried guarding for nil on > that line allows configuring to finish, but it predictably continues to > explode during actual operation when I create a new instance of :answer > -- I knew that was a longshot, but any help would be appreciated. I'm not > particularly experienced with sphinx or thinking-sphinx, I inherited this > project after it was already in place (the move to uuid primary keys is > fairly recent, and this is the last major blocker) so just let me know if > you need any additional info or context. > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To post to this group, send email to [email protected] > <javascript:>. > Visit this group at https://groups.google.com/group/thinking-sphinx. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.
