I'd like multiple define_index calls to define multiple indexes. I've  
just rolled out some changes that lets people define multiple sources  
within a define_index block (although this is the first time I've  
mentioned it):
   define_index do
     define_source do
       # ...
     end
   end

If define_source isn't called (as per pretty much everyone's config  
currently), it just creates a default source.

I've not made any changes for define_index to now work reliably for  
multiple indexes though. If you want to tackle that, please do. I've  
been considering it as a way to allow multiple language translations  
of a record. I'm not sure how Sphinx handles the same document across  
multiple indexes though. Something work clarifying on the Sphinx  
forum, perhaps.

Cheers

-- 
Pat

On 18/05/2009, at 7:57 AM, aitrus wrote:

>
> I'll look at how difficult it might be to add these changes into
> TSphinx, as well.  They're pretty much invaluable.
>
> On May 15, 5:20 pm, aitrus <[email protected]> wrote:
>> I ran into an issue and decided to experiment with having multiple
>> indexes in one table--that I could use with thinking sphinx.  When
>> doing generic searches, I don't want case sensitivity to be an issue.
>> I also want to be able to do partial searches, using asterisks.
>>
>> However, I also want to do case-sensitive searches against the full,
>> literal value of a column.  So, "AbCD*" would only match a search of
>> "AbCD*" and not "AbCD" or "AbC*", etc.
>>
>> Inside my model, if I do two define_index 's, It creates two sources
>> (as seen below in my pastie).  However, it only creates one
>> index ..._core.  So if I set any conflicting property values in the
>> define indexes, it will only use one of them.
>>
>> In addition, if the two define_index 's do not have the same number  
>> of
>> records / attributes / etc, Sphinx will error out when trying to  
>> index
>> them due to a mismatch.  Soo...  I half fixed the issue below, by  
>> semi-
>> customizing that section in the sphinx.conf.  See here:
>>
>> http://pastie.org/479699
>>
>> I had to create two "index ..._core_XX" entries and told the index to
>> point at both.  This lets me have two sets of files with a different
>> number of attributes and different properties.
>>
>> One issue, however is now this:
>>
>>>> GeneralResource.search :conditions => {:profile_name_lit =>  
>>>> "TSTCERT.xfgyhd"}, :limit => 1
>>
>> => [nil]
>>
>> This doesn't happen with every value.  I'm still doing some testing  
>> to
>> see why (exactly) it will behave like this.
>>
>> But... I think supporting this would be a very worthwhile change to
>> Thinking Sphinx.
> >


--~--~---------~--~----~------------~-------~--~----~
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