I'm also not entirely sure how US did it - although I may have stolen  
their approach for TS. It's been a while. Thinking Sphinx calculates  
an offset on the primary key, based on the number of indexed models,  
and the array index of current model within that array of all indexed  
models, to ensure each document id is unique. If you look at the  
generated SQL in your sphinx.conf files, this should be reasonably  
clear. I guess you could factor in an application id into the mix as  
well.

As for costs, I'm not sure - I'm in Australia though, so hopefully the  
exchange rate doesn't jump around too much. Either way, if you'd like  
me to sketch out a rough timeline and cost, let's continue this  
discussion offlist :)

Cheers

-- 
Pat

On 09/11/2009, at 8:46 PM, Spike wrote:

>
> Hehe, thanks Pat :)
>
> The source thing sounds good. Our ultrasphinx mod used bitshifting in
> the upper range of the index for each record to identify which
> database the record belonged to. I'm not sure if thinking sphinx does
> a similar thing with regards to encoding the class of an object in the
> index id? I'm also not sure of the details of how it was done in US
> since I didn't do it, but maybe i'll learn something by
> investigating :D
>
> What approximate cost would you assign to a modification of this type?
> Us poor New Zealanders are at the mercy of harsh currency exchange
> rates but I'd be interested to know none the less :D We have about 100
> schools using our CMS system so the benefit to them (and to us for a
> non-crashing, anti-not-working search engine is pretty obvious) :D
>
> Cheers for your help :)
>
> Brendon
>
> On Nov 6, 3:59 pm, Pat Allan <[email protected]> wrote:
>> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to