確定,而出現,你可以通過它進行排序MVA,
sphinxQL>select id,bucket_id from gi_stemmed where match('bridge') order by bucket_id desc;
+---------+-----------+
| id | bucket_id |
+---------+-----------+
| 4135611 | 492 |
| 4135609 | 492 |
| 4132078 | 492 |
| 4130626 | 492 |
| 4117904 | 492 |
| 4114632 | 490 |
| 4087884 | 490 |
| 4087786 | 490 |
| 4087767 | 490 |
| 4087010 | 490 |
| 4086927 | 490 |
| 4086920 | 490 |
| 4086125 | 490 |
| 4083465 | 761 |
| 4081812 | 491 |
| 4081713 | 490 |
| 4065533 | 490 |
| 4065427 | 490 |
| 4065338 | 490 |
| 4065321 | 490 |
+---------+-----------+
Server version: 2.2.1-dev (r4133)
即沒有錯誤。它不完全工作。有幾個結果不按順序(參見上面示例中的2/3下降)
但是有一個GREATEST()
函數,它在你的問題中像MAX一樣工作。
sphinxQL>select id,bucket_id,greatest(bucket_id) as two from gi_stemmed where match('bridge road') order by two desc;
根據文檔,情況並非如此...... http://sphinxsearch.com/docs/manual-2.1.7.html#mva「這對於實現文章標籤,產品類別,等等。支持在MVA屬性上過濾和分組(**,但不分類**)。「 – Ian 2014-08-28 17:37:23
我猜文檔必須過時。上面的例子來自現場服務器。我在'製作'中使用這種排序。 – barryhunter 2014-08-28 21:08:43
嗯,這一直嘮叨我,所以跑了一些更多的測試,而它**似乎**工作,它不完全確切。有一些無序結果。但是有一個最好的(或者至少是!)函數,應該可以工作:) – barryhunter 2014-08-29 09:35:35