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 ..
本文探讨了使用Sphinx搜索引擎时遇到的浮点数排序问题,即SetSortMode(SPH_SORT_ATTR_ASC, 'floatVar')导致的排序结果不符合预期的情况,并提供了一种通过表达式排序的替代解决方案。
9112

被折叠的 条评论
为什么被折叠?



