getLuceneIndex(); $hits = $index->find($query); $pks = array(); foreach ($hits as $hit) { $pks[] = $hit->pk; } if (empty($pks)) { return array(); } $q = $this->createQuery('p') ->whereIn('p.id', $pks) ->andWhere('p.is_published = 1') ->andWhere('time_start < NOW()') ->andWhere('time_end > NOW()') ->andWhere('is_finished = 0') ->limit(20); return $q->execute(); } }