setup in Model
define_index do
  indexes :name, :as => 'name', :sortable => true
end

config file snippet
sql_query = SELECT `model`.`id` * 2 + 0 AS `id` , CAST(`model`.`name`
AS CHAR) AS `name_sort`, ...

expected config file snippet
sql_query = SELECT `model`.`id` * 2 + 0 AS `id` , CAST(`model`.`name`
AS CHAR) AS `name`, ...

The problem only occurs when using the :as option. Would you like me
to file a bug on github?

Thanks,
Greg

On Jun 13, 9:45 am, Pat Allan <[email protected]> wrote:
> Hi Greg
>
> I'm afraid I'm not really understanding what the issue you're having  
> is. Can you provide a bit more information, and maybe the contents of  
> your define_index block?
>
> Cheers
>
> --
> Pat
>
> On 12/06/2009, at 11:20 AM, Greg Weber wrote:
>
>
>
> > The sql that TS generates for my sortable string column should look
> > like
> > CAST(`value` AS CHAR) AS `value` ... IFNULL(`value`, '') AS
> > `value_sort`
>
> > but I end up with 2 _sorts - the CAST part gives a _sort:
> > CAST(`value` AS CHAR) AS `value_sort`
>
> > I have had this problem with a very old version of sphinx and on the
> > latest. I solve this now with a regex post-processing.
--~--~---------~--~----~------------~-------~--~----~
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