0

我不熟悉使用 Sphinx 和 Thinking Sphinx gem。我有一列最多有 6 位整数,当我对该列进行排序时,默认情况下我最多只能得到 5 位数字,而当它对它们进行排序时,它只按第一个数字进行排序,所以它看起来像这样

99999
99998
99997
...
89999
...
79999
...
100999 <- Higher 6 digit number showing up here
10999
10998

即使我的数字高于 99999 这个所以它应该看起来像这样

100999
100998
100997
...
...
99999
99998

任何帮助深表感谢

4

1 回答 1

1

Make sure that you store integers as integers in your DB.

If it's in a string, no one will complain and everything'll work fine until you want to sort them :)

于 2012-08-04T12:53:19.440 回答