gpt4 book ai didi

mysql - Sphinx:类似于mysql的select

转载 作者:行者123 更新时间:2023-11-30 01:21:57 24 4
gpt4 key购买 nike

如何使用类似mysql的select?例如我想匹配 category=3

中的单词

我尝试过的

    SELECT * FROM online WHERE MATCH('hello') and category=3 LIMIT 0,5; SHOW META;
ERROR 1064 (42000): index online: no such filter attribute 'category'

describe online;
+------------+-----------+
| Field | Type |
+------------+-----------+
| id | bigint |
| title | field |
| full_story | field |
| category | field |
| date | timestamp |
+------------+-----------+

没有和类别=3

SELECT * FROM online WHERE MATCH('test') LIMIT 0,5;
+-------+------+
| id | date |
+-------+------+
| 8190 | 2012 |
| 2865 | 2012 |
| 3843 | 2012 |
| 5362 | 2013 |
| 11201 | 2012 |
+-------+------+
5 rows in set (0.00 sec)

最佳答案

您需要将类别作为属性而不是字段。

有一个整数属性类型:)

关于mysql - Sphinx:类似于mysql的select,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18434297/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com