Setting SPHINX_VERSION as system-wide environment variable worked. Perhaps it should be mentioned in the README.
Thanks. J. On Sat, Jul 13, 2013 at 3:38 AM, Pat Allan <[email protected]> wrote: > I'm not quite sure how to set environment variables, but I'm wondering if > this is related to the Riddle gem failing to detect which version of Sphinx > you've got installed. If you can set the SPHINX_VERSION environment > variable to 2.0.8, that could help. > > You'll definitely need to use mysql41 instead of port - my guess of the > original error is that it's using the old binary Sphinx protocol on 9306 > instead of the mysql41 protocol, which is why Sphinx is active on 9306 but > expecting different sets of bytes. > > -- > Pat > > On 12/07/2013, at 10:55 PM, J. Garcia wrote: > > > With mysql41: 9306 in thinking_sphinx.yml: > > > > > rake ts:index --trace > > ** Invoke ts:index (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute ts:index > > Generating configuration to > E:/home/myproject/config/development.sphinx.conf > > rake aborted! > > Riddle::Configuration::ConfigurationError > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/riddle-1.5.7/lib/riddle/configuration/searchd.rb:24:in > `render' > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/riddle-1.5.7/lib/riddle/configuration.rb:37:in > `render' > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.4/lib/thinking_sphinx/configuration.rb:84:in > `render' > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.4/lib/thinking_sphinx/configuration.rb:90:in > `block in render_to_file' > > C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:35:in `open' > > C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:35:in `open' > > ... > > > > If I just delete the 9306 line, the same error. > > > > If I revert it back to port: 9306, it works well: > > > > E:\home\elektrik\proyectos\rails\music_collect>rake ts:index --trace > > ** Invoke ts:index (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute ts:index > > Generating configuration to > E:/home/myproject/config/development.sphinx.conf > > Sphinx 2.0.8-release (r3831) > > Copyright (c) 2001-2012, Andrew Aksyonoff > > Copyright (c) 2008-2012, Sphinx Technologies Inc ( > http://sphinxsearch.com) > > > > using config file 'E:/home/myproject/config/development.sphinx.conf'... > > WARNING: key 'address' is deprecated in > E:/home/myproject/config/development.sphinx.conf line 7; use 'listen' > instead. > > indexing index 'brand_core'... > > collected 1000 docs, 0.0 MB > > sorted 0.0 Mhits, 100.0% done > > total 1000 docs, 17768 bytes > > total 0.093 sec, 189041 bytes/sec, 10639.42 docs/sec > > total 2 reads, 0.000 sec, 21.4 kb/call avg, 0.0 msec/call avg > > total 9 writes, 0.001 sec, 11.5 kb/call avg, 0.1 msec/call avg > > > > Also, the ts:start produces this log in development.searchd.log file: > > > > [Fri Jul 12 14:50:18.387 2013] [ 2768] listening on 127.0.0.1:9306 > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: replaying log > E:/home/elektrik/proyectos/rails/music_collect/tmp/binlog/development/binlog.001 > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: replay stats: 0 rows in 0 > commits; 0 updates; 0 indexes > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: finished replaying > E:/home/myproject/tmp/binlog/development/binlog.001; 0.0 MB in 0.000 sec > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: replaying log > E:/home/myproject/tmp/binlog/development/binlog.002 > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: replay stats: 0 rows in 0 > commits; 0 updates; 0 indexes > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: finished replaying > E:/home/myproject/tmp/binlog/development/binlog.002; 0.0 MB in 0.000 sec > > [Fri Jul 12 14:50:18.391 2013] [ 2768] binlog: replaying log > E:/home/myproject/tmp/binlog/development/binlog.003 > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: replay stats: 0 rows in 0 > commits; 0 updates; 0 indexes > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: finished replaying > E:/home/myproject/tmp/binlog/development/binlog.003; 0.0 MB in 0.000 sec > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: replaying log > E:/home/myproject/tmp/binlog/development/binlog.004 > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: replay stats: 0 rows in 0 > commits; 0 updates; 0 indexes > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: finished replaying > E:/home/myproject/tmp/binlog/development/binlog.004; 0.0 MB in 0.000 sec > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: replaying log > E:/home/myproject/tmp/binlog/development/binlog.005 > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: replay stats: 0 rows in 0 > commits; 0 updates; 0 indexes > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: finished replaying > E:/home/myproject/tmp/binlog/development/binlog.005; 0.0 MB in 0.000 sec > > [Fri Jul 12 14:50:18.392 2013] [ 2768] binlog: finished replaying total > 5 in 0.001 sec > > [Fri Jul 12 14:50:18.394 2013] [ 2768] accepting connections > > > > On Thursday, July 11, 2013 7:28:27 PM UTC+2, J. Garcia wrote: > > I'm having a hard time trying to set up a working thinking-sphinx > configuration. > > > > My setup: > > • Win 7 > > • Rails: 3.2.13 > > • MySql: 5.5.32 > > • Ruby:1.9.3 > > • Sphinx:2.0.8 > > • thinking_sphinx:3.0.4 > > • mysql2: 0.3.12b5 > > I must say there was hardly no info on how to get started with > thinking_sphinx. > > After adding the gem, and googling a lot, I added a > config/thinking_sphinx.yml and put this onto it: > > > > development: > > host: localhost > > port: 9306 > > bin_path: F:\sw\sphinx-2.0.8-release-win32\bin > > searchd_binary_name: searchd > > indexer_binary_name: indexer > > > > Notice it says port, and not mysql41 as it is explained in > thinking_sphinx. > > > > The app/indices part was documented well and I created this folder and > added a model_index.rb file as explained. > > > > After this, I run: > > rake ts:index > > > > and if successfully indexed my model entities and created a > development.sphinx.conf file: > > > > Generating configuration to > E:/home/my_project/config/development.sphinx.conf > > Sphinx 2.0.8-release (r3831) > > Copyright (c) 2001-2012, Andrew Aksyonoff > > Copyright (c) 2008-2012, Sphinx Technologies Inc ( > http://sphinxsearch.com) > > > > using config file > 'E:/home/my_project/rails/music_collect/config/development.sphinx.conf'... > > WARNING: key 'address' is deprecated in > E:/home/my_project/config/development.sphinx.conf line 7; use 'listen' > instead. > > indexing index 'mymodel_core'... > > collected 1000 docs, 0.0 MB > > sorted 0.0 Mhits, 100.0% done > > total 1000 docs, 17768 bytes > > total 0.037 sec, 470003 bytes/sec, 26452.22 docs/sec > > total 2 reads, 0.000 sec, 21.4 kb/call avg, 0.0 msec/call avg > > total 9 writes, 0.000 sec, 11.5 kb/call avg, 0.0 msec/call avg > > rotating indices: successfully sent SIGHUP to searchd (pid=7456). > > > > However, when I call MyModel.search in my controller, I get this error: > > > > Mysql2::Error at /mymodels > > > > Lost connection to MySQL server at 'reading initial communication > packet', system error: 0 > > > > It works fine if I do a MyModel.all , which directly talks to MySql > backend. > > > > Any help would be appreciated. > > > > > > -- > > 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 http://groups.google.com/group/thinking-sphinx. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Thinking Sphinx" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/thinking-sphinx/a8Pww2WnDbg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/thinking-sphinx. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 http://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/groups/opt_out.
