Hi Matt

I think you'll need to create your own custom function in SQL - I  
can't spot anything in the function list for MySQL:
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html

Although if you're using Postgres, perhaps that has something that fits.

Greg's outlined a good example for custom fields and attributes though  
- make sure you provide an alias and a type (in your case, :string).

Hope this helps.

-- 
Pat

On 10/06/2009, at 4:31 PM, Matt wrote:

>
> Any hints as to how I'd do this in SQL? I'm not sure I understood how
> it relates to the "RADIANS" line you included.
>
> On Jun 10, 1:33 pm, Greg Weber <[email protected]> wrote:
>> One way would be to try do it in SQL, although you probably would  
>> want
>> to create a validation on usernames to prevent any new users from
>> cheating.
>>
>> has "RADIANS(latitude)",  :as => :latitude,  :type => :float
>>
>> On Jun 10, 9:28 am, Matt <[email protected]> wrote:
>>
>>
>>
>>> I have a search that returns items ordered by their name. However,
>>> some users cheat and put special characters or numbers in the  
>>> front of
>>> their name to show up first. Does anyone have any suggestions on how
>>> to prevent this?
>>
>>> Ideally I could use a regexp to strip out any of these characters  
>>> from
>>> the front of a name, but I'm not sure how to implement this in my
>>> define_index block.
>>
>>> Thanks.
> >


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