Hello,
I have an issue of sorting on facet.
I have an index ‘PRODUCTS’ i want to facet on one filed ‘BRAND’ and sort by brand
so here my query
SELECT * FROM PRODUCTS FACET BRAND ORDER BY BRAND ASC
All results of my index works
All results of my facet its okay, there are 2 columns
brand and count(*)
±------------------±---------+
| marque_produit | count(*) |
±------------------±---------+
| A. Vogel | 95 |
| Daktarin | 8 |
| Autre | 3996 |
| Hibi | 10 |
| Lohmann Rauscher | 193 |
| Kela | 37 |
| Galenco | 5 |
| Aproten | 14 |
| Qualiphar | 53 |
But the order by does not work
If I apply the order by on count, that work but not a string ?
Can you help me ?
Thank you
Manticore 3.3.0 01fc8ad1@200204 release
Ubuntu 18.04.4 LTS
tomat
2
seems like a bug. could you create github ticket where to put data to reproduce issue locally?
Sergey
3
Indeed looks like a bug. Here’s how to reproduce:
mysql> create table PRODUCTS(f text, BRAND string);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into products(BRAND) values('A. Vogel'),('A. Vogel'),('Autre'),('Lohmann Rauscher'),('Qualiphar'),('Qualiphar'),('Qualiphar'),('Qualiphar'),('Kela');
Query OK, 9 rows affected (0.00 sec)
mysql> select brand from products limit 0 facet brand order by facet() asc;
Empty set (0.00 sec)
+------------------+----------+
| brand | count(*) |
+------------------+----------+
| Lohmann Rauscher | 1 |
| Qualiphar | 4 |
| A. Vogel | 2 |
| Kela | 1 |
| Autre | 1 |
+------------------+----------+
5 rows in set (0.00 sec)
mysql> select brand from products limit 0 facet brand order by brand asc;
Empty set (0.00 sec)
+------------------+----------+
| brand | count(*) |
+------------------+----------+
| A. Vogel | 2 |
| Autre | 1 |
| Lohmann Rauscher | 1 |
| Qualiphar | 4 |
| Kela | 1 |
+------------------+----------+
5 rows in set (0.00 sec)
Works fine for ints:
mysql> create table products(f text, i int);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into products(i) values (1),(3),(5),(2),(4),(4);
Query OK, 6 rows affected (0.00 sec)
mysql> select * from products limit 0 facet i order by i asc;
Empty set (0.00 sec)
+------+----------+
| i | count(*) |
+------+----------+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 1 |
+------+----------+
5 rows in set (0.00 sec)
mysql> select * from products limit 0 facet i order by facet() asc;
Empty set (0.00 sec)
+------+----------+
| i | count(*) |
+------+----------+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 1 |
+------+----------+
5 rows in set (0.00 sec)
tomat
4
I created ticket at Github#320 with data that reproduces issue.
You might subscribe here to be informed when issue got closed.
tomat
5
I’ve just fixed this issue at master branch commit 0f3299d56007a600a45d694b5e0eefcd9d136f85
You might build Manticore from master branch to get this case fixed