Actually, just figured the cause: you need to set the attribute's name  
as a symbol, not a string:
   :as => :helloworld

This should avoid the name duplication (haven't looked into the code  
in depth to figure out why, just tried to add failing specs)

-- 
Pat

On 23/08/2009, at 11:54 AM, Pat Allan wrote:

>
> Hi Pascal
>
> Normally, TS should create two attributes, one named as you requested,
> the other with the _facet suffix - *IF* dealing with arrays of items
> that aren't all integers (or timestamps, which can be considered
> integers). Because you're using a manual SQL string, TS has no idea
> what the underlying type is for items in the array, and so assumes
> that they're strings, hence the duplication as a CRC'd version of the
> data.
>
> That said, it should not be naming both versions of the attribute the
> same thing - so that's a bug. I'll try to investigate it today.
>
> -- 
> Pat
>
> On 23/08/2009, at 10:08 AM, pascal wrote:
>
>>
>> Hi
>>
>> I'm still trying to add a type multi attribute as a facet with a
>> subselect query.
>>
>> When i add an attribute with a custom subselect with :type => :multi
>> and :facet => true then the attribute appears twice in the config and
>> "_facet" is appended to attribute name.
>>
>> So after:
>> has '(select (group_concat ...) from ... where ...)', :as =>
>> 'helloworld', :type => :multi, :facet => true
>>
>> I have twice the attr config:
>>
>> sql_attr_multi = uint helloworld_facet from field
>> sql_attr_multi = uint helloworld_facet from field
>>
>> and the helloworld_facet appears twice in the sql_query, once with
>> IFNULL and once with CRC32
>>
>> Running ts:in works nut yields following warning:
>> WARNING: attribute 'helloworld_facet' not found - IGNORING
>>
>>
>> Why is "_facet" appended to the name?
>> Why is attribute config doubled?
>>
>>
>>
>> Thanks for your help.
>>
>> Pascal
>>>
>
>
> >


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