add empty extractTerms(): LUCENE-556

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@407903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2006-05-19 20:29:09 +00:00
parent 1e700534cc
commit 2c5bc593b8
3 changed files with 15 additions and 0 deletions

View File

@ -65,6 +65,10 @@ Bug fixes
didn't know about the field yet, reader didn't keep track if it had deletions,
and deleteDocument calls could circumvent synchronization on the subreaders.
(Chuck Williams via Yonik Seeley)
14. LUCENE-556: Added empty extractTerms() implementation to MatchAllDocsQuery and
ConstantScoreQuery in order to allow their use with a MultiSearcher.
(Yonik Seeley)
1.9.1

View File

@ -20,6 +20,7 @@ import org.apache.lucene.index.IndexReader;
import java.io.IOException;
import java.util.BitSet;
import java.util.Set;
/**
* A query that wraps a filter and simply returns a constant score equal to the
@ -39,6 +40,11 @@ public class ConstantScoreQuery extends Query {
return this;
}
public void extractTerms(Set terms) {
// OK to not add any terms when used for MultiSearcher,
// but may not be OK for highlighting
}
protected class ConstantWeight implements Weight {
private Similarity similarity;
private float queryNorm;

View File

@ -25,6 +25,8 @@ import org.apache.lucene.search.Similarity;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.ToStringUtils;
import java.util.Set;
/**
* A query that matches all documents.
*
@ -132,6 +134,9 @@ public class MatchAllDocsQuery extends Query {
return new MatchAllDocsWeight(searcher);
}
public void extractTerms(Set terms) {
}
public String toString(String field) {
StringBuffer buffer = new StringBuffer();
buffer.append("MatchAllDocsQuery");