Sphinx question and "connect_to_admin"

4 views
Skip to first unread message

Yuki (aka Rubén Gómez)

unread,
Aug 7, 2008, 7:21:24 AM8/7/08
to ins...@googlegroups.com
Hello!

The first question is about ultrasphinx and its daemon. I have done
what README.rdoc says doing:
$ rake db:sample_data:reload
$ rake ultrasphinx:configure
$ rake ultrasphinx:index
$ rake ultrasphinx:daemon:start

The daemon is running.
$ cat log/searchd.log
[Thu Aug 7 12:50:47.363 2008] [ 9773] creating server socket on 0.0.0.0:3312
[Thu Aug 7 12:50:47.363 2008] [ 9773] accepting connections

I have created a new user, but when I search for it, it doesn't
uppear. When does the reindex process restart? I have been watching
the ultrasphinx/default.base but I don't know what the parameter is
for change it. Or must I do manually when I want the reindex or create
a cron for it? (I'm in develompent env)

I began to change some aspect of Insoshi, and the first thing I have
changed is the "connect_to_admin" when a new person is created. I
don't want my admin has a lot of contacts, so I decided to comment
that.

The question is why are 3 spec's refering to it? The errors appears on
lines 82, 94 and 137 on spec/models/person_spec.rb I think that
"connect to admin" should be an option in the preferences panel, what
do you think? Maybe you have discussed it before.

Thanks for reading!

Long Nguyen

unread,
Aug 7, 2008, 6:18:53 PM8/7/08
to ins...@googlegroups.com
You do need to manually reindex with ultrasphinx.

The command that you need to run in the development environment is just

rake ultrasphinx:index

The running daemon will be notified and load in the updated index (aka index rotation).

If you want to set up a cronjob (not quite recommended for development work but necessary for any production application), take a look at the ultrasphinx deployment notes:

http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/DEPLOYMENT_NOTES.html

Insoshi isn't configured for delta indexing so you'll need to reindex the main index more often.  It actually just takes on order of seconds.  (FYI, dogfood just takes 1.0+-0.2s to be fully reindexed.  We reindex every half hour.)

This behavior is different than ferret where the index was automatically updated with the database records.  However, the problem with that was whenever ferret had an issue (ferret_server went down, etc.) you had the possibility of it taking down the whole site.  Runtime issues with ultrasphinx should be isolated to just the search functionality.

The automatic connection only happens with the first admin for the site.  It's kind of nice that new site members start off with at least one contact.  The failing specs you're getting with your changes are related to the activity that it's expecting to be generated as part of being connected to the admin (lines 82 and 94 in person_spec.rb) and that the admin is always the first contact for new members (line 137)

Having that as a preference setting is a possibility.  If you'd be able to contribute that change, that'd be great!  Let me know if you have any questions on how to do that.

Long
--
Long Nguyen
long....@insoshi.com
Reply all
Reply to author
Forward
0 new messages