Your query can be seen as an inner join: select t0.* from employee t0 inner join employee t1 on t0.dept_no = t1.dept_no where t1.email='a...@email.com'
Maybe JoinUtill can help you. http://lucene.apache.org/core/7_0_0/join/org/apache/lucene/search/join/JoinUtil.html?is-external=true On Tue, Apr 10, 2018 at 10:44 AM, Khurram Shehzad <khurram_sheh...@live.com> wrote: > Hi guys! > > > I've a scenario where the lucene query depends on the result of another > lucene query. > > > For example, find all the employees of the department where one of its > employee's email address = 'a...@email.com' > > > SQL would be like: > > > select * from employee where dept_no in( > > select dept_no from employee where email = 'a...@email.com' > > ) > > > Please note that employee is a huge data and inner query can result into 5 > million rows > > > Any thoughts how to replicate this scenario using core lucene? > > > Regards, > > Khurram >