mirror of https://github.com/apache/lucene.git
SOLR-5718: Make LBHttpSolrServer zombie checks non-distrib and non-scoring.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1568394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
43ab8b9ef2
commit
0b023e5236
|
@ -334,6 +334,9 @@ Bug Fixes
|
|||
* SOLR-5731: In ConnectionManager, we should catch and only log exceptions
|
||||
from BeforeReconnect. (Mark Miller)
|
||||
|
||||
* SOLR-5718: Make LBHttpSolrServer zombie checks non-distrib and non-scoring.
|
||||
(Christine Poerschke via Mark Miller)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,
|
|||
for (String shard : sreq.actualShards) {
|
||||
ModifiableSolrParams params = new ModifiableSolrParams(sreq.params);
|
||||
params.remove(ShardParams.SHARDS); // not a top-level request
|
||||
params.set("distrib", "false"); // not a top-level request
|
||||
params.set(CommonParams.DISTRIB, "false"); // not a top-level request
|
||||
params.remove("indent");
|
||||
params.remove(CommonParams.HEADER_ECHO_PARAMS);
|
||||
params.set(ShardParams.IS_SHARD, true); // a sub (shard) request
|
||||
|
|
|
@ -42,6 +42,8 @@ import java.util.regex.Pattern;
|
|||
*/
|
||||
public class SolrQuery extends ModifiableSolrParams
|
||||
{
|
||||
public static final String DOCID = "_docid_"; // duplicate of org.apache.solr.search.QueryParsing.DOCID which is not accessible from here
|
||||
|
||||
public enum ORDER { desc, asc;
|
||||
public ORDER reverse() {
|
||||
return (this == asc) ? desc : asc;
|
||||
|
@ -897,6 +899,10 @@ public class SolrQuery extends ModifiableSolrParams
|
|||
this.set(CommonParams.DEBUG_QUERY, String.valueOf(showDebugInfo));
|
||||
}
|
||||
|
||||
public void setDistrib(boolean val) {
|
||||
this.set(CommonParams.DISTRIB, String.valueOf(val));
|
||||
}
|
||||
|
||||
|
||||
public SolrQuery setStart(Integer start) {
|
||||
if( start == null ) {
|
||||
|
|
|
@ -101,6 +101,16 @@ public class LBHttpSolrServer extends SolrServer {
|
|||
|
||||
static {
|
||||
solrQuery.setRows(0);
|
||||
/**
|
||||
* Default sort (if we don't supply a sort) is by score and since
|
||||
* we request 0 rows any sorting and scoring is not necessary.
|
||||
* SolrQuery.DOCID schema-independently specifies a non-scoring sort.
|
||||
* <code>_docid_ asc</code> sort is efficient,
|
||||
* <code>_docid_ desc</code> sort is not, so choose ascending DOCID sort.
|
||||
*/
|
||||
solrQuery.setSort(SolrQuery.DOCID, SolrQuery.ORDER.asc);
|
||||
// not a top-level request, we are interested only in the server being sent to i.e. it need not distribute our request to further servers
|
||||
solrQuery.setDistrib(false);
|
||||
}
|
||||
|
||||
protected static class ServerWrapper {
|
||||
|
|
|
@ -48,6 +48,9 @@ public interface CommonParams {
|
|||
/** query string */
|
||||
public static final String Q ="q";
|
||||
|
||||
/** distrib string */
|
||||
public static final String DISTRIB = "distrib";
|
||||
|
||||
/** sort order */
|
||||
public static final String SORT ="sort";
|
||||
|
||||
|
|
Loading…
Reference in New Issue