Thanks Pat. Works perfectly! :) --------------------------------------------------------- Ahmed El-Daly Chief Guru DeveloperGurus Inc. on budget, on time T: 416-566-4945 | developergurus.com
On 2013-01-15, at 5:59 PM, "Pat Allan" <[email protected]> wrote: > Hi Ahmed > > Just yesterday I pushed a patch to get searching working on namespaced models > - essentially, the class names need to be quoted in the query > (@sphinx_internal_class_name ("Lcbo::Store")). So if you grab the latest from > the edge branch, you should be good to go. > > gem 'thinking-sphinx', > :git => 'git://github.com/pat/thinking-sphinx.git', > :ref => 'bb56c29ea5' > > As for index definitions, it's mentioned in the README (but many things are, > so you have to know to look for it) - the index reference should be a string, > with a slash indicating the namespaced nature of the model: > > ThinkingSphinx::Index.define 'lcbo/store', with: :active_record do > # > end > > Hope this helps! > > -- > Pat > > On 16/01/2013, at 4:45 AM, Daly wrote: > >> I have a model called Lcbo::Store, after upgrading to version 3.0.0 I can't >> seem to use sphinx with it anymore. After much tinkering, I've reached the >> following config: >> >> # app/indices/store_index.rb >> ThinkingSphinx::Index.define :"Lcbo::Store", name:"lcbo_store", with: >> :active_record, delta:false do >> indexes :address >> indexes :intersection >> indexes city.name, as: :city >> end >> >> running rake ts:index now runs successfully and generates the proper entry >> in development.sphinx.conf. Unfortunately, it still fails with an actual >> search with: >> >> Mysql2::Error (sphinxql: syntax error, unexpected WHERE, expecting IDENT >> near 'WHERE MATCH('brampto @sphinx_internal_class_name (Lcbo::Store)') AND >> sphinx_deleted = 0 LIMIT 0, 100; SHOW META'): >> >> What config changes do I need to make to have this work? >> >> Thanks, >> Ahmed >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Thinking Sphinx" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/thinking-sphinx/-/bVointrCX88J. >> 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. > > > > -- > 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. > -- 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.
