我的搜索查询是这样的
SELECT files.id,files.file,files.name,files.uid,files.size,files.downloads,files.deleted,files.descr,
files.upload_id,files.thumb,files.category,files.expirydate,
MATCH(name,descr) AGAINST ('$all $none $any' In BOOLEAN MODE) AS score, users.`user`
FROM files Inner Join users ON files.uid = users.id
WHERE MATCH(name,descr) AGAINST ('$all $none $any' IN BOOLEAN MODE) AND files.deleted = 0 ORDER BY score DESC
在此$all $none $any
中,用户可以搜索关键字以进行搜索。
我想根据类别缩小搜索结果的范围,以便为此编写查询。
我尝试在AND files.deleted = 0 AND category= 'Other'
之后添加这样的东西这很好但只是如果用户选择了两个类别来搜索这个不起作用,我使用AND category= 'Other' AND category = 'Images'
谢谢。
答案 0 :(得分:1)
... files.deleted = 0 AND category IN('Other','Images')