hibernate search多条件限制查询

最近在使用hibernate search时遇到了一些问题希望有大神能帮助解决

如何多个限制条件限制下进行查询?

举例如下:

我有三个实体:学生(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