Hi Brendon
Sounds like you want multiple sources - which, at a basic level, is in
Thinking Sphinx (though it's not publicised):
define_index do
define_source do
# usual field and attribute stuff here
end
define_source do
# other fields and attributes
end
end
I guess if you can use some metaprogramming to generate a source for
each client, then that would be a start... but there's complications
with Sphinx expecting a unique id per document across the entire
setup, so you'd need to customise the offset that TS generates.
Hopefully that gives you a headstart.
As for something official in Thinking Sphinx... I've only heard of
such a request once before, so I'm not sure if it's worth paying for.
If you insist, then I'll consider it :)
That said, given this is Thinking Sphinx month, I'm not running out of
bugs to fix and features to add.
--
Pat
On 06/11/2009, at 1:02 PM, Spike wrote:
>
> Hi there, from my code hunting and general searching I've pretty much
> determined that thinking sphinx doesn't support indexing the same
> models across a series of databases.
>
> I have a CMS app and each clients data is stored in a separate
> database for many reasons. When the rails app gets a connection it
> looks at the hostname requested and switches databases accordingly. It
> all works quote well except when it comes to search. I managed to get
> Ferret to work with multiple databases by adding another key which was
> the database name to the ferret index. I also had someone hack
> ultrasphinx so that it would encode the database in the upper digits
> of the sphinx index. I've decided to make the switch to thinking
> sphinx because the setup for ultrasphinx is both complicated and fails
> quite a lot (well the indexer does anyway).
>
> Can someone point me in the right direction with regards to modifying
> thinking sphinx to work with multiple databases? From what I can tell
> most of the changes would be in the configuration.rb file where code
> would have to be added to loop both databases and models and index
> them appropriately.
>
> Any tips would be greatly appreciated, and I would seriously consider
> paying to get it added as an official feature of thinking sphinx.
>
> Looking forward to hearing from you :)
>
> Brendon
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---