package lux.solr;

import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.search.SortSpec;

public class CloudQueryRequest extends SolrQueryRequestBase {

    private final SortSpec sortSpec;
    
    public CloudQueryRequest(SolrCore core, SolrParams params, SortSpec sortSpec) {
        super(core, params);
        this.sortSpec = sortSpec;
    }
    
    public SortSpec getSortSpec() {
        return sortSpec;
    }

}

@@ -99,16 +99,74 @@
 lrCore;%0A
+import org.apache.solr.handler.component.ResponseBuilder;%0A
 import o
@@ -314,16 +314,48 @@
 Base %7B%0A%0A
+    private int nextStage;%0A    %0A
     priv
@@ -531,24 +531,86 @@
 = sortSpec;%0A
+        this.nextStage = ResponseBuilder.STAGE_EXECUTE_QUERY;%0A
     %7D%0A    %0A 
@@ -674,12 +674,449 @@
 c;%0A    %7D
+%0A    %0A    /**%0A     * @return the next stage in the sharded request processing.  This is settable so we can control%0A     * the stage from within SolrURIResolver (which only retrieves fields) and CloudSearchIterator (which%0A     * uses the 2-pass query/retrieval mechanism).%0A     */%0A    public int getNextStage() %7B%0A        return nextStage;%0A    %7D%0A    %0A    public void setNextStage (int nextStage) %7B%0A        this.nextStage = nextStage;%0A    %7D
 %0A%0A%7D%0A

enable control over request stage to skip searching when retrieving a single doc