我正在编写一个过滤算法,它将用户输入作为数组,比如
@keywords = [['undergrad','grad'],['SAT', 'GPA'], ['Stanford']]
并查询表,例如我数据库中的视频表。表中有一个字符串字段,其中包含几个用逗号分隔的标签。
逻辑是:
In all videos, if the tags include "undergrad", "grad", returned those videos;
In the returned videos, if the tags include "SAT", "GPA", returned those videos;
In the returned videos, if the tags include "Stanford", returned those videos;
在 Rails 上实现它有什么帮助吗?