Народ, подскажите, как правильно написать запросы с IF() чтобы получилось примерно такое:
select id, if(group_id > 0, 1, 0) as hasGroup from products where hasGroup > 0;
select id from products where if(group_id > 0, 1, 0) > 0;
MySQL [(none)]> select id, group_id from products limit 4;
+-------+----------+
| id | group_id |
+-------+----------+
| 28934 | 84 |
| 28955 | 105 |
| 28956 | 299 |
| 28957 | 107 |
+-------+----------+
4 rows in set (0.000 sec)
MySQL [(none)]> select id, if(group_id > 0, 1, 0) as hasGroup from products where hasGroup > 0;
ERROR 1064 (42000): index products: parse error: Sphinx expr: syntax error, unexpected '(', `expecting $end near '(group_id > 0, 1, 0)'`
Your MySQL connection id is 54
Server version: 3.5.0 1d34c491@200722 release git branch HEAD (no branch)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Я пытаюсь поднять поисковый сервис который работает на Sphinx 3, на мантикор
Конфигурация слишком большая, поэтому вынес её в пасту https://pastebin.com/SVh9jgHB
Команды create table products2 (f text, group_id int); не проходят. Ошибка: ERROR 1064 (42000): CREATE TABLE requires data_dir to be set in the config file
Если в конфигурацию добавляю настройку data_dir = /var/manticore, то сервер не запускается, ошибка: [47:42.797] [101] using config file '/app/etc/base.conf' (8328 chars)... [47:42.798] [101] FATAL: 'data_dir' cannot be mixed with index declarations in '/app/etc/base.conf'