mirror of https://github.com/apache/lucene.git
SOLR-3240: add "spellcheck.collateMaxCollectDocs" (removing dead code).
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1479645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7141cb35a7
commit
67e922c392
|
@ -226,7 +226,7 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
|
|||
.setMaxCollationEvaluations(maxCollationEvaluations)
|
||||
.setSuggestionsMayOverlap(suggestionsMayOverlap)
|
||||
.setDocCollectionLimit(maxCollationCollectDocs)
|
||||
.setReportHits(collationExtendedResults);
|
||||
;
|
||||
List<SpellCheckCollation> collations = collator.collate(spellingResult, q, rb);
|
||||
//by sorting here we guarantee a non-distributed request returns all
|
||||
//results in the same order as a distributed request would,
|
||||
|
|
|
@ -1237,7 +1237,6 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
|
|||
static final int NO_CHECK_FILTERCACHE = 0x20000000;
|
||||
static final int NO_SET_QCACHE = 0x10000000;
|
||||
public static final int TERMINATE_EARLY = 0x04;
|
||||
public static final int FORCE_INORDER_COLLECTION = 0x08;
|
||||
public static final int GET_DOCLIST = 0x02; // get the documents actually returned in a response
|
||||
public static final int GET_SCORES = 0x01;
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ public class SpellCheckCollator {
|
|||
private int maxCollationEvaluations = 10000;
|
||||
private boolean suggestionsMayOverlap = false;
|
||||
private int docCollectionLimit = 0;
|
||||
private boolean reportHits = true;
|
||||
|
||||
public List<SpellCheckCollation> collate(SpellingResult result,
|
||||
String originalQuery, ResponseBuilder ultimateResponse) {
|
||||
|
@ -142,11 +141,7 @@ public class SpellCheckCollator {
|
|||
queryComponent.prepare(checkResponse);
|
||||
if (docCollectionLimit > 0) {
|
||||
int f = checkResponse.getFieldFlags();
|
||||
checkResponse.setFieldFlags(f |= SolrIndexSearcher.TERMINATE_EARLY);
|
||||
if (reportHits) {
|
||||
f = checkResponse.getFieldFlags();
|
||||
checkResponse.setFieldFlags(f |= SolrIndexSearcher.FORCE_INORDER_COLLECTION);
|
||||
}
|
||||
checkResponse.setFieldFlags(f |= SolrIndexSearcher.TERMINATE_EARLY);
|
||||
}
|
||||
queryComponent.process(checkResponse);
|
||||
hits = (Integer) checkResponse.rsp.getToLog().get("hits");
|
||||
|
@ -259,9 +254,5 @@ public class SpellCheckCollator {
|
|||
public SpellCheckCollator setDocCollectionLimit(int docCollectionLimit) {
|
||||
this.docCollectionLimit = docCollectionLimit;
|
||||
return this;
|
||||
}
|
||||
public SpellCheckCollator setReportHits(boolean reportHits) {
|
||||
this.reportHits = reportHits;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue