sphinx coreseek SetSortMode(SPH_SORT_ATTR_ASC, '') 對float 排序設置bug

when I use SetSortMode(SPH_SORT_ATTR_ASC, 'floatVar'), it works unexpectedly. for example, I have a float Var ranging from [-10.0, 10.0] when I SetSortMode(SPH_SORT_ATTR_ASC, 'floatVar', the result is

0
0
0
1.5
2.5
8
-1.5
-2.5
-8
...

why? where I go wrong ?

I just use another solution to solve it ,using

         case 'sentiment':
             $sphinxapi->SetSortMode(SPH_SORT_EXPR, 'sentiment');
         break;
         case 'sentiment.desc':
             $sphinxapi->SetSortMode(SPH_SORT_EXPR, '-sentiment');
         break;

but I still confused why the SPH_SORT_ATTR_ASC didn't work ..

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章