Search in sources :

Example 1 with ProcessedFilter

use of org.apache.solr.search.SolrIndexSearcher.ProcessedFilter in project lucene-solr by apache.

the class CommandHandler method execute.

@SuppressWarnings("unchecked")
public void execute() throws IOException {
    final int nrOfCommands = commands.size();
    List<Collector> collectors = new ArrayList<>(nrOfCommands);
    for (Command command : commands) {
        collectors.addAll(command.create());
    }
    ProcessedFilter filter = searcher.getProcessedFilter(queryCommand.getFilter(), queryCommand.getFilterList());
    Query query = QueryUtils.makeQueryable(queryCommand.getQuery());
    if (truncateGroups) {
        docSet = computeGroupedDocSet(query, filter, collectors);
    } else if (needDocset) {
        docSet = computeDocSet(query, filter, collectors);
    } else if (!collectors.isEmpty()) {
        searchWithTimeLimiter(query, filter, MultiCollector.wrap(collectors.toArray(new Collector[nrOfCommands])));
    } else {
        searchWithTimeLimiter(query, filter, null);
    }
}
Also used : Query(org.apache.lucene.search.Query) BooleanQuery(org.apache.lucene.search.BooleanQuery) QueryCommand(org.apache.solr.search.QueryCommand) ProcessedFilter(org.apache.solr.search.SolrIndexSearcher.ProcessedFilter) ArrayList(java.util.ArrayList) DocSetCollector(org.apache.solr.search.DocSetCollector) TimeLimitingCollector(org.apache.lucene.search.TimeLimitingCollector) AllGroupHeadsCollector(org.apache.lucene.search.grouping.AllGroupHeadsCollector) MultiCollector(org.apache.lucene.search.MultiCollector) TotalHitCountCollector(org.apache.lucene.search.TotalHitCountCollector) Collector(org.apache.lucene.search.Collector)

Aggregations

ArrayList (java.util.ArrayList)1 BooleanQuery (org.apache.lucene.search.BooleanQuery)1 Collector (org.apache.lucene.search.Collector)1 MultiCollector (org.apache.lucene.search.MultiCollector)1 Query (org.apache.lucene.search.Query)1 TimeLimitingCollector (org.apache.lucene.search.TimeLimitingCollector)1 TotalHitCountCollector (org.apache.lucene.search.TotalHitCountCollector)1 AllGroupHeadsCollector (org.apache.lucene.search.grouping.AllGroupHeadsCollector)1 DocSetCollector (org.apache.solr.search.DocSetCollector)1 QueryCommand (org.apache.solr.search.QueryCommand)1 ProcessedFilter (org.apache.solr.search.SolrIndexSearcher.ProcessedFilter)1