I've set up Thinking Sphinx gem https://github.com/pat/thinking-sphinx and I'm trying to get it work with globalize https://github.com/globalize/globalize gem.
I have a model named Content that has :name, :body ,:summary attributes and also has
translates :name, :body, :summary, :fallbacks_for_empty_translations => true
for translations. I've created a content_index that has
ThinkingSphinx::Index.define :content, :with => :active_record do
indexes translations.summary, :sortable => true
indexes translations.body , :sortable => true
where "content_translations.locale = 'my_locale'"
end
When I do rake ts:index
or rake ts:rebuild
I get
Generating configuration to rails_app_path/config/development.sphinx.conf Sphinx 2.1.8-id64-release (rel21-r4675) Copyright (c) 2001-2014, Andrew Aksyonoff Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'rails_app_path/config/development.sphinx.conf'... indexing index 'content_core'...
collected 43 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 43 docs, 3266 bytes
total 0.005 sec, 616808 bytes/sec, 8120.86 docs/sec
skipping non-plain index 'content'...
total 3 reads, 0.000 sec, 1.3 kb/call avg, 0.0 msec/call avg
total 10 writes, 0.000 sec, 1.5 kb/call avg, 0.0 msec/call avg
rotating indices: successfully sent SIGHUP to searchd (pid=8282).
So when I get to rails console (rails c) and try something like
Content.search "something"
I get empty results.
2.1.2 :050 > Content.search("something")
Sphinx Query (0.6ms) SELECT * FROM
content_core
WHERE MATCH('something') ANDsphinx_deleted
= 0 LIMIT 0, 20Sphinx Found 0 results
=> []
Does skipping non-plain index 'content'...
line in ts:rebuild
task has anything to do with it?