我有三个实体:学生(student),老师(teacher),课程(course)
学生和老师、课程均为多对多关系。现在我直接按照学生姓名进行全文检索可以实现,但我想加上两个限制条件进行搜索:1、老师编号(001,005),2、课程编号(x1,x2,x3)。
要求搜索结果:
1. 匹配学生姓名关键字
2. 老师范围限制在(001,005)
3. 课程编号限制为以上给定的几个之一
from User u where u.teacherId in ('001','005') and u.classesId in (x1,x2,x3) and u.name like '%'+key+'%'
from User u where u.teacherId in ('001','005') and u.classesId in (x1,x2,x3) and u.name like '%'+key+'%'
elasticsearch