[Xapian-discuss] Bug: scriptindex - xapian-omega 0.9.99_svn8484

Kevin Duraj kevin.softdev at gmail.com
Mon May 14 18:42:12 BST 2007


- The issue here is not padding numerical by zero and make numerical looks
like strings.
- The issue is not that this is common mistake.
- The issue is: that sorting numerical is faster then sorting strings, or
sorting strings is faster then numerical?
- The issue is: What is faster when sorting?

Cheers,
  Kevin Duraj

On 5/12/07, Rafael SDM Sierra <rafaeljsg14 at gmail.com> wrote:
>
> On 5/11/07, Olly Betts <olly at survex.com> wrote:
> > If you want numbers to sort numerically, you'll either need to zero (or
> > space) pad them, or prefix the length of the integer part (say prefix
> > A for 1 up to Z for 26).  For example:
> >
> > Value                   Zero Pad                   Length Prefix
> >
> > 0                       00000000                   A0
> > 9.48910782703839        00000009.48910782703839    A9.48910782703839
> > 12                      00000012                   B12
> > 44.7864142310669        00000044.7864142310669     B44.7864142310669
> > 997.4                   00000997.4                 C997.4
> > 1000000                 01000000                   G1000000
> >
>
> This is a commom mistake (I fall in this trap too :P), I'll write a
> page in the wiki to explain this behavior and how to correct (Python
> an C++).
>
> I'll post this in my blog too (portuguese version).
>
> --
> Rafael "SDM" Sierra
> http://stiod.com.br/
>



-- 
Kevin Duraj
http://myhealthcare.com


More information about the Xapian-discuss mailing list