# How did ferret sort by the column?

**URL:** <https://www.ruby-forum.com/t/how-did-ferret-sort-by-the-column/103700>\
**Category:** Ferret\
**Created:** [May 9, 2007, 1:26pm UTC](https://www.ruby-forum.com/t/how-did-ferret-sort-by-the-column/103700 "2007-05-09T13:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@jin](https://www.ruby-forum.com/u/jin)\
**Post date:** [May 9, 2007, 1:26pm UTC](https://www.ruby-forum.com/t/how-did-ferret-sort-by-the-column/103700/1 "2007-05-09T13:26:30Z")

</div>

Consider that if i have a column and the type is int or date  
then i pass the :sort field with it i must sort by the value

but if a column which type is string and i set the :sort as it  
how did ferret sort by it?  
seems it is sort by the first letter of this column according to the  
result

i read the source code but stopped in the c code,because i am not  
familiar with it and it is complex…

so can anybody give me the answer?  
hope i have describe this question clearly  
I want to know the mechanism  
thank you
