Good afternoon-

I am working on a distributed TS implementation which is working quite
well.  When I get through a few more steps I want to write this up,
because I am blown away with how well Sphinx actually supports
distributed search.

My question is this, in order to get Sphinx to not have ID collisions
if it searches across multiple indexes some SQL tricks need to be
performed in $RAILS_ENV.sphinx.conf file.  This hack is from the
sphinx forums:

On Node 1:

sql_query = SELECT "assets"."id" * 1 + 0... (this is the default
generated by rake ts:conf/rake ts:in)

change to:

sql_query = SELECT "assets"."id" * 10 + 1...

On Node 2:

sql_query = SELECT "assets"."id" * 1 + 0... (this is the default
generated by rake ts:conf/rake ts:in)

change to:

sql_query = SELECT "assets"."id" * 10 + 2...

The net result of this is that all IDs returned by the distributed
search can be related to the node based on the value of the least
significant digit.  This works, I have a prototype using straight
Riddle that gets the appropriate results and can get to the correct
ActiveRecord object on the correct node.  Very cool stuff.

What worries me is the possibility of rake ts:in trampling the changes
to $RAILS_ENV.sphinx.conf.  Is there a syntax that can be used in the
define_index block within the model?  What about in sphinx.yml?

Best,

Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to