[KinoSearch] Sorting numeric fields
Darian Anthony Patrick
darian at criticode.com
Thu Apr 23 08:22:00 PDT 2009
Darian Anthony Patrick wrote:
> Hello all,
>
> I'm indexing a field containing prices, and I'm attempting to sort
> results based on that price field. It appears that KinoSearch is
> sorting from the the leftmost digit to the right, instead of right to
> left, ie. when sorting in descending order the results are ordered 995,
> 99000, 9900, 990, 99, 989, 985...2025, 2015, etc. This is incorrect for
> this particular field.
>
> Do I need to specify a new FieldSpec for integer fields that I'd like to
> sort on properly?
>
> Many thanks in advance,
>
> Darian
>
Nevermind. I solved the problem by ensuring that all prices were the
same width by left padding an appropriate number of zeros. The
following entry from the archive was helpful:
http://www.rectangular.com/pipermail/kinosearch/2005-July/005174.html
--
Darian Anthony Patrick, Criticode LLC
Office: (215) 789-9956
Facsimile: (866) 789-2992
Email/XMPP: darian at criticode.com
Web: http://criticode.com
=================================================
BCF1 E7AD 15AD 8A99 F613 AF5F 2A9C C45C F580 E087
=================================================
* Signed and encrypted communications preferred.
More information about the kinosearch
mailing list