Integration TS in Refinery CMS

76 views
Skip to first unread message

Louis-Philippe

unread,
Aug 17, 2012, 9:35:35 AM8/17/12
to thinkin...@googlegroups.com
Hi,

I try to integrate TS with Refinery but it seems that TS doesn't find / execute my define_index method. Here is the message when running ts:index "FATAL: no indexes found in config file '.../config/development.sphinx.conf' Only indexer and searchd sections are filled, no source, nor index.

I wonder if it can be due to the complexity of the structure. The model is in /vendor/extensions/models, :

module Refinery
  module Products
    class Product < Refinery::Core::BaseModel    
      self.table_name = 'refinery_products'
      ...
      define_index do
         indexes name
          set_property :delta => true
      end
      ...
    end
   end
end

Thx by advance for your help !

Pat Allan

unread,
Aug 17, 2012, 10:50:28 AM8/17/12
to thinkin...@googlegroups.com
Hi Louis-Philippe

Thinking Sphinx only looks in app/models by default, but you can add additional model paths easy enough - probably put this in an initializer:

ThinkingSphinx::Configuration.instance.model_directories << Rails.root.join('vendor/extensions/models')

Cheers

--
Pat

> --
> 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/-/uvPjRU_zficJ.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.



Louis-Philippe

unread,
Aug 17, 2012, 12:24:19 PM8/17/12
to thinkin...@googlegroups.com
Hi Pat,

Thx for your quick reply.

Il have created a thinking_sphinx.rb initializer with ThinkingSphinx::Configuration.instance.model_directories << "vendor/extensions/*/app/models/refinery" as mentionned on the blog but when I run ts:index I always receive the message FATAL: no indexes found in config file '...'

Cheers.

Pat Allan

unread,
Aug 17, 2012, 2:19:17 PM8/17/12
to thinkin...@googlegroups.com
It's probably best to use absolute paths - so try the following instead:

ThinkingSphinx::Configuration.instance.model_directories << Rails.root.join("vendor/extensions/*/app/models")

If Rails.root doesn't work (I'm not familiar with Refinery), then use some other way to get the full path.

Cheers

--
Pat

> --
> 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/-/rgDTZuikb9YJ.

Louis-Philippe

unread,
Aug 18, 2012, 3:57:57 AM8/18/12
to thinkin...@googlegroups.com
Many thx for your help Pat. I tried this too but doesn't work ...
Reply all
Reply to author
Forward
0 new messages