connecting with multiple search daemons from a single application

10 views
Skip to first unread message

cec

unread,
Oct 24, 2011, 9:37:18 AM10/24/11
to Thinking Sphinx
Hi,

I'have two rails applications, that both use TS to index their models.

As a new requirement, application A needs to be able to search in
model M of application B.

After adding to A's database.yml the connection details for the db of
application B and duplicating M, I wonder what is the best approach to
enable searching.

Do I have to define in A the same index on M that I use in B?
(application A won't modify instance of M, so I don't need any
deltas :) )

Is there a way to have TS talk to a different searchd instance when
searching trhough M?

Thank you!

Harun Pathan

unread,
Oct 26, 2011, 5:25:43 AM10/26/11
to thinkin...@googlegroups.com
If both the rails applications are different, then why not to create API call at B's end to return results of a search query. 
Otherwise you would have to replicate models, monkey patch search calls which is not good. It would be nice to have APIs and let consumer use that API.

If A needs to get results from B (any model). create API at B end, to return results based on query and content type. 

Hope this helps

Thanks,
Harun


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




--
Thanks,
Harun @harunpathan


cec

unread,
Oct 27, 2011, 6:02:09 PM10/27/11
to Thinking Sphinx
Sry for the late reply.
actually the setup you described is what we had till now, but for
performance and other reasons, we decidede to switch from ARes to a
direct connection to the other db

Pat Allan

unread,
Oct 27, 2011, 11:27:16 PM10/27/11
to thinkin...@googlegroups.com
You probably don't need to replicate the full contents of the index, but certainly having an index on each model is probably necessary. You'll also need to ensure that TS connects to Sphinx on the same address and port.

Let us know how you go.

--
Pat

Reply all
Reply to author
Forward
0 new messages