Question

I need to connect my application to external server with Sphinx. Sphinx is used by many applications and I'm not administrating it. What I need to set in my application to connect to that external server with Thinking Sphinx?

I assume I don't run rake ts:start as I'm not using local daemon and I'm not doing any indexing.

I added file thinking_sphinx.yml in my config directory with settings for address and mysql41. When I try to run search from console I get:

User.search('jon', indices: [ 'users' ] ) 
(Object doesn't support #inspect)
 =>

Do I need any more settings for Thinking Sphinx to work in my application?

EDIT:

I asked Sphinx administrator to change index name to user_core so I don't need to specify index. When I run:

User.search('jon').first

I get:

NoMethodError: undefined method `constantize' for nil:NilClass

Any help will be appreciated

Was it helpful?

Solution

Is this Sphinx server set up separately to your local Thinking Sphinx configuration? Thinking Sphinx expects certain attributes to exist in the Sphinx indices (and, as you've discovered, certain naming conventions). It also needs to be using the same data source as your ActiveRecord models.

In short - if the Sphinx configuration isn't generated by Thinking Sphinx, I'd be extremely hesitant to mix it and Thinking Sphinx together.

But otherwise: the full stack trace of the NoMethodError would be useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top