List of usage examples for org.apache.solr.handler.component ResponseBuilder STAGE_EXECUTE_QUERY
int STAGE_EXECUTE_QUERY
To view the source code for org.apache.solr.handler.component ResponseBuilder STAGE_EXECUTE_QUERY.
Click Source Link
From source file:lux.solr.XQueryComponent.java
License:Mozilla Public License
/** * Process for a distributed search. This method is called at various stages * during the processing of a request:/*from w ww . j a v a 2s.c om*/ * * During ResponseBuilder.STAGE_PARSE_QUERY we parse, optimize, compile and * execute the XQuery query. When a lux:search call is encountered, it will * create a SearchResultIterator, which creates a Lucene Query and calls * back into the SearchHandler; then subsequent phases are handled by the * normal QueryComponent. * * @return the next stage for this component */ @Override public int distributedProcess(ResponseBuilder rb) throws IOException { if (rb.grouping()) { throw new SolrException(ErrorCode.BAD_REQUEST, "Solr grouping not supported for XQuery"); } if (rb.stage == ResponseBuilder.STAGE_PARSE_QUERY) { if (rb.req instanceof CloudQueryRequest) { CloudQueryRequest cloudReq = (CloudQueryRequest) rb.req; // the sort spec has already been generated rb.setSortSpec(cloudReq.getSortSpec()); return ResponseBuilder.STAGE_EXECUTE_QUERY; } else { process(rb); return ResponseBuilder.STAGE_DONE; } } else { return super.distributedProcess(rb); } }
From source file:org.alfresco.solr.component.AsyncBuildSuggestComponent.java
License:Open Source License
/** Dispatch shard request in <code>STAGE_EXECUTE_QUERY</code> stage */ @Override//from w w w .j a v a 2 s . c o m public int distributedProcess(ResponseBuilder rb) { SolrParams params = rb.req.getParams(); LOG.debug("SuggestComponent distributedProcess with : " + params); if (rb.stage < ResponseBuilder.STAGE_EXECUTE_QUERY) return ResponseBuilder.STAGE_EXECUTE_QUERY; if (rb.stage == ResponseBuilder.STAGE_EXECUTE_QUERY) { ShardRequest sreq = new ShardRequest(); sreq.purpose = ShardRequest.PURPOSE_GET_TOP_IDS; sreq.params = new ModifiableSolrParams(rb.req.getParams()); sreq.params.remove(ShardParams.SHARDS); rb.addRequest(this, sreq); return ResponseBuilder.STAGE_GET_FIELDS; } return ResponseBuilder.STAGE_DONE; }