0

我想按表达式排序,然后按某个属性升序,然后按另一个属性升序。像这样的东西::order => "(a < some constant) desc, b asc, c asc"。如何得到它?

扩展排序由于<. 由于逗号,Expr 失败。

我已经设法产生:order => "(a < some constant) desc, b desc"与 with等效的排序:order => "(a < some constant)", :sort_mode => :expr, :sort_by => :b,但我不能c向该排序添加另一个属性 (),也不能将排序模式更改为basc。

4

1 回答 1

0

SetSelect函数允许创建任意排序。我不确定它是否在thinking-sphinx 中可用,因此可能需要修改这个gem。

于 2010-09-24T11:11:33.933 回答