You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by us...@apache.org on 2009/10/13 16:28:02 UTC
svn commit: r824781 - in /lucene/java/trunk: ./
contrib/memory/src/java/org/apache/lucene/index/memory/
contrib/memory/src/test/org/apache/lucene/index/memory/
contrib/remote/src/java/org/apache/lucene/search/
contrib/surround/src/test/org/apache/lucen...
Author: uschindler
Date: Tue Oct 13 14:28:01 2009
New Revision: 824781
URL: http://svn.apache.org/viewvc?rev=824781&view=rev
Log:
LUCENE-1978: Remove the rest of deprecated HitCollectors
Removed:
lucene/java/trunk/src/java/org/apache/lucene/search/HitCollector.java
lucene/java/trunk/src/java/org/apache/lucene/search/HitCollectorWrapper.java
lucene/java/trunk/src/java/org/apache/lucene/search/TimeLimitedCollector.java
Modified:
lucene/java/trunk/CHANGES.txt
lucene/java/trunk/common-build.xml
lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
lucene/java/trunk/contrib/remote/src/java/org/apache/lucene/search/RemoteSearchable.java
lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java
lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java
lucene/java/trunk/src/java/org/apache/lucene/search/Collector.java
lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java
lucene/java/trunk/src/java/org/apache/lucene/search/Searchable.java
lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java
lucene/java/trunk/src/java/org/apache/lucene/search/TermScorer.java
lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Oct 13 14:28:01 2009
@@ -56,9 +56,9 @@
* LUCENE-1975: Remove deprecated SpanQuery.getTerms() and generify
Query.extractTerms(Set<Term>) (Michael Busch)
-* LUCENE-1972: Remove deprecated ExtendedFieldCache, custom and auto
- caches, SortField.AUTO, deprecated custom sort, deprecated sorting
- HitCollectors, deprecated TopDocs HitCollectors, legacy search.
+* LUCENE-1972, LUCENE-1978: Remove deprecated ExtendedFieldCache,
+ custom and auto caches, SortField.AUTO, deprecated custom sort,
+ deprecated HitCollector, legacy search setting in SortField.
Make new Sort(SortField...) and Sort.setSort(SortField...) varargs-
enabled. (Uwe Schindler)
Modified: lucene/java/trunk/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/common-build.xml?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/common-build.xml (original)
+++ lucene/java/trunk/common-build.xml Tue Oct 13 14:28:01 2009
@@ -42,7 +42,7 @@
<property name="Name" value="Lucene"/>
<property name="dev.version" value="3.0-dev"/>
<property name="version" value="${dev.version}"/>
- <property name="compatibility.tag" value="lucene_2_9_back_compat_tests_20091013b"/>
+ <property name="compatibility.tag" value="lucene_2_9_back_compat_tests_20091013c"/>
<property name="spec.version" value="${version}"/>
<property name="year" value="2000-${current.year}"/>
<property name="final.name" value="lucene-${name}-${version}"/>
Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java (original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java Tue Oct 13 14:28:01 2009
@@ -43,10 +43,11 @@
import org.apache.lucene.index.TermPositions;
import org.apache.lucene.index.TermVectorMapper;
import org.apache.lucene.index.FieldInvertState;
-import org.apache.lucene.search.HitCollector;
+import org.apache.lucene.search.Collector;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Similarity;
/**
@@ -414,10 +415,22 @@
Searcher searcher = createSearcher();
try {
final float[] scores = new float[1]; // inits to 0.0f (no match)
- searcher.search(query, new HitCollector() {
- public void collect(int doc, float score) {
- scores[0] = score;
+ searcher.search(query, new Collector() {
+ private Scorer scorer;
+
+ public void collect(int doc) throws IOException {
+ scores[0] = scorer.score();
+ }
+
+ public void setScorer(Scorer scorer) throws IOException {
+ this.scorer = scorer;
}
+
+ public boolean acceptsDocsOutOfOrder() {
+ return true;
+ }
+
+ public void setNextReader(IndexReader reader, int docBase) { }
});
float score = scores[0];
return score;
Modified: lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Tue Oct 13 14:28:01 2009
@@ -42,11 +42,13 @@
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexReader;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.HitCollector;
+import org.apache.lucene.search.Collector;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Searcher;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
@@ -424,11 +426,23 @@
else
searcher = ((MemoryIndex) index).createSearcher();
- final float[] scores = new float[1]; // inits to 0.0f
- searcher.search(query, new HitCollector() {
- public void collect(int doc, float score) {
- scores[0] = score;
+ final float[] scores = new float[1]; // inits to 0.0f (no match)
+ searcher.search(query, new Collector() {
+ private Scorer scorer;
+
+ public void collect(int doc) throws IOException {
+ scores[0] = scorer.score();
+ }
+
+ public void setScorer(Scorer scorer) throws IOException {
+ this.scorer = scorer;
}
+
+ public boolean acceptsDocsOutOfOrder() {
+ return true;
+ }
+
+ public void setNextReader(IndexReader reader, int docBase) { }
});
float score = scores[0];
// Hits hits = searcher.search(query);
Modified: lucene/java/trunk/contrib/remote/src/java/org/apache/lucene/search/RemoteSearchable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/remote/src/java/org/apache/lucene/search/RemoteSearchable.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/remote/src/java/org/apache/lucene/search/RemoteSearchable.java (original)
+++ lucene/java/trunk/contrib/remote/src/java/org/apache/lucene/search/RemoteSearchable.java Tue Oct 13 14:28:01 2009
@@ -44,13 +44,6 @@
super();
this.local = local;
}
-
- /** @deprecated use {@link #search(Weight, Filter, Collector)} instead. */
- public void search(Weight weight, Filter filter, HitCollector results)
- throws IOException {
- local.search(weight, filter, results);
- }
-
public void search(Weight weight, Filter filter, Collector results)
throws IOException {
local.search(weight, filter, results);
Modified: lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java (original)
+++ lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTst.java Tue Oct 13 14:28:01 2009
@@ -17,10 +17,14 @@
* limitations under the License.
*/
+import java.io.IOException;
+
+import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Query;
-import org.apache.lucene.search.HitCollector;
import org.apache.lucene.queryParser.surround.parser.QueryParser;
@@ -52,16 +56,32 @@
public void setVerbose(boolean verbose) {this.verbose = verbose;}
- class TestCollector extends HitCollector { // FIXME: use check hits from Lucene tests
+ class TestCollector extends Collector { // FIXME: use check hits from Lucene tests
int totalMatched;
boolean[] encountered;
+ private Scorer scorer = null;
+ private int docBase = 0;
TestCollector() {
totalMatched = 0;
encountered = new boolean[expectedDocNrs.length];
}
- public void collect(int docNr, float score) {
+ public void setScorer(Scorer scorer) throws IOException {
+ this.scorer = scorer;
+ }
+
+ public boolean acceptsDocsOutOfOrder() {
+ return true;
+ }
+
+ public void setNextReader(IndexReader reader, int docBase) throws IOException {
+ this.docBase = docBase;
+ }
+
+ public void collect(int docNr) throws IOException {
+ float score = scorer.score();
+ docNr += docBase;
/* System.out.println(docNr + " '" + dBase.getDocs()[docNr] + "': " + score); */
TestCase.assertTrue(queryText + ": positive score", score > 0.0);
TestCase.assertTrue(queryText + ": too many hits", totalMatched < expectedDocNrs.length);
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer.java Tue Oct 13 14:28:01 2009
@@ -270,11 +270,6 @@
return false;
}
-
- /** @deprecated use {@link #score(Collector, int, int)} instead. */
- protected boolean score(HitCollector hc, int max) throws IOException {
- return score(new HitCollectorWrapper(hc), max, docID());
- }
public int advance(int target) throws IOException {
throw new UnsupportedOperationException();
@@ -328,11 +323,6 @@
public void score(Collector collector) throws IOException {
score(collector, Integer.MAX_VALUE, nextDoc());
}
-
- /** @deprecated use {@link #score(Collector)} instead. */
- public void score(HitCollector hc) throws IOException {
- score(new HitCollectorWrapper(hc));
- }
public String toString() {
StringBuilder buffer = new StringBuilder();
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java Tue Oct 13 14:28:01 2009
@@ -261,16 +261,6 @@
}
/** Scores and collects all matching documents.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * <br>When this method is used the {@link #explain(int)} method should not be used.
- * @deprecated use {@link #score(Collector)} instead.
- */
- public void score(HitCollector hc) throws IOException {
- score(new HitCollectorWrapper(hc));
- }
-
- /** Scores and collects all matching documents.
* @param collector The collector to which all matching documents are passed through.
* <br>When this method is used the {@link #explain(int)} method should not be used.
*/
@@ -280,19 +270,6 @@
collector.collect(doc);
}
}
-
- /** Expert: Collects matching documents in a range.
- * <br>Note that {@link #next()} must be called once before this method is
- * called for the first time.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * @param max Do not score documents past this.
- * @return true if more matching documents may remain.
- * @deprecated use {@link #score(Collector, int, int)} instead.
- */
- protected boolean score(HitCollector hc, int max) throws IOException {
- return score(new HitCollectorWrapper(hc), max, docID());
- }
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
doc = firstDocID;
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Collector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Collector.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Collector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Collector.java Tue Oct 13 14:28:01 2009
@@ -26,13 +26,6 @@
* gather raw results from a search, and implement sorting
* or custom result filtering, collation, etc. </p>
*
- * <p>As of 2.9, this class replaces the deprecated
- * HitCollector, and offers an API for efficient collection
- * of hits across sequential {@link IndexReader}s. {@link
- * IndexSearcher} advances the collector through each of the
- * sub readers, in an arbitrary order. This results in a
- * higher performance means of collection.</p>
- *
* <p>Lucene's core collectors are derived from Collector.
* Likely your application can use one of these classes, or
* subclass {@link TopDocsCollector}, instead of
@@ -60,8 +53,7 @@
*
* <li>{@link TimeLimitingCollector}, which wraps any other
* Collector and aborts the search if it's taken too much
- * time, will subclass Collector in 3.0 (presently it
- * subclasses the deprecated HitCollector).</li>
+ * time.</li>
*
* <li>{@link PositiveScoresOnlyCollector} wraps any other
* Collector and prevents collection of hits whose score
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionSumScorer.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionSumScorer.java Tue Oct 13 14:28:01 2009
@@ -25,7 +25,6 @@
/** A Scorer for OR like queries, counterpart of <code>ConjunctionScorer</code>.
* This Scorer implements {@link Scorer#skipTo(int)} and uses skipTo() on the given Scorers.
- * TODO: Implement score(HitCollector, int).
*/
class DisjunctionSumScorer extends Scorer {
/** The number of subscorers. */
@@ -109,16 +108,6 @@
}
/** Scores and collects all matching documents.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * <br>When this method is used the {@link #explain(int)} method should not be used.
- * @deprecated use {@link #score(Collector)} instead.
- */
- public void score(HitCollector hc) throws IOException {
- score(new HitCollectorWrapper(hc));
- }
-
- /** Scores and collects all matching documents.
* @param collector The collector to which all matching documents are passed through.
* <br>When this method is used the {@link #explain(int)} method should not be used.
*/
@@ -132,19 +121,6 @@
/** Expert: Collects matching documents in a range. Hook for optimization.
* Note that {@link #next()} must be called once before this method is called
* for the first time.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * @param max Do not score documents past this.
- * @return true if more matching documents may remain.
- * @deprecated use {@link #score(Collector, int, int)} instead.
- */
- protected boolean score(HitCollector hc, int max) throws IOException {
- return score(new HitCollectorWrapper(hc), max, docID());
- }
-
- /** Expert: Collects matching documents in a range. Hook for optimization.
- * Note that {@link #next()} must be called once before this method is called
- * for the first time.
* @param collector The collector to which all matching documents are passed through.
* @param max Do not score documents past this.
* @return true if more matching documents may remain.
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Scorer.java Tue Oct 13 14:28:01 2009
@@ -55,16 +55,6 @@
}
/** Scores and collects all matching documents.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * <br>When this method is used the {@link #explain(int)} method should not be used.
- * @deprecated use {@link #score(Collector)} instead.
- */
- public void score(HitCollector hc) throws IOException {
- score(new HitCollectorWrapper(hc));
- }
-
- /** Scores and collects all matching documents.
* @param collector The collector to which all matching documents are passed.
* <br>When this method is used the {@link #explain(int)} method should not be used.
*/
@@ -76,19 +66,6 @@
}
}
- /** Expert: Collects matching documents in a range. Hook for optimization.
- * Note that {@link #next()} must be called once before this method is called
- * for the first time.
- * @param hc The collector to which all matching documents are passed through
- * {@link HitCollector#collect(int, float)}.
- * @param max Do not score documents past this.
- * @return true if more matching documents may remain.
- * @deprecated use {@link #score(Collector, int, int)} instead.
- */
- protected boolean score(HitCollector hc, int max) throws IOException {
- return score(new HitCollectorWrapper(hc), max, docID());
- }
-
/**
* Expert: Collects matching documents in a range. Hook for optimization.
* Note, <code>firstDocID</code> is added to ensure that {@link #nextDoc()}
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Searchable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Searchable.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Searchable.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Searchable.java Tue Oct 13 14:28:01 2009
@@ -43,26 +43,6 @@
*/
public interface Searchable {
- /** Lower-level search API.
- *
- * <p>{@link HitCollector#collect(int,float)} is called for every non-zero
- * scoring document.
- * <br>HitCollector-based access to remote indexes is discouraged.
- *
- * <p>Applications should only use this if they need <i>all</i> of the
- * matching documents. The high-level search API ({@link
- * Searcher#search(Query)}) is usually more efficient, as it skips
- * non-high-scoring hits.
- *
- * @param weight to match documents
- * @param filter if non-null, used to permit documents to be collected.
- * @param results to receive hits
- * @throws BooleanQuery.TooManyClauses
- * @deprecated use {@link #search(Weight, Filter, Collector)} instead.
- */
- void search(Weight weight, Filter filter, HitCollector results)
- throws IOException;
-
/**
* Lower-level search API.
*
@@ -115,7 +95,6 @@
* <p>Applications should usually call {@link Searcher#search(Query)} or
* {@link Searcher#search(Query,Filter)} instead.
* @throws BooleanQuery.TooManyClauses
- * @deprecated use {@link #search(Weight, Filter, int)} instead.
*/
TopDocs search(Weight weight, Filter filter, int n) throws IOException;
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Searcher.java Tue Oct 13 14:28:01 2009
@@ -51,26 +51,6 @@
}
/** Lower-level search API.
- *
- * <p>{@link HitCollector#collect(int,float)} is called for every matching
- * document.
- *
- * <p>Applications should only use this if they need <i>all</i> of the
- * matching documents. The high-level search API ({@link
- * Searcher#search(Query)}) is usually more efficient, as it skips
- * non-high-scoring hits.
- * <p>Note: The <code>score</code> passed to this method is a raw score.
- * In other words, the score will not necessarily be a float whose value is
- * between 0 and 1.
- * @throws BooleanQuery.TooManyClauses
- * @deprecated use {@link #search(Query, Collector)} instead.
- */
- public void search(Query query, HitCollector results)
- throws IOException {
- search(createWeight(query), null, new HitCollectorWrapper(results));
- }
-
- /** Lower-level search API.
*
* <p>{@link Collector#collect(int)} is called for every matching document.
*
@@ -90,28 +70,6 @@
/** Lower-level search API.
*
- * <p>{@link HitCollector#collect(int,float)} is called for every matching
- * document.
- * <br>HitCollector-based access to remote indexes is discouraged.
- *
- * <p>Applications should only use this if they need <i>all</i> of the
- * matching documents. The high-level search API ({@link
- * Searcher#search(Query, Filter, int)}) is usually more efficient, as it skips
- * non-high-scoring hits.
- *
- * @param query to match documents
- * @param filter if non-null, used to permit documents to be collected.
- * @param results to receive hits
- * @throws BooleanQuery.TooManyClauses
- * @deprecated use {@link #search(Query, Filter, Collector)} instead.
- */
- public void search(Query query, Filter filter, HitCollector results)
- throws IOException {
- search(createWeight(query), filter, new HitCollectorWrapper(results));
- }
-
- /** Lower-level search API.
- *
* <p>{@link Collector#collect(int)} is called for every matching
* document.
* <br>Collector-based access to remote indexes is discouraged.
@@ -199,15 +157,6 @@
return result;
}
- /* The following abstract methods were added as a workaround for GCJ bug #15411.
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15411
- */
- /**
- * @deprecated use {@link #search(Weight, Filter, Collector)} instead.
- */
- public void search(Weight weight, Filter filter, HitCollector results) throws IOException {
- search(weight, filter, new HitCollectorWrapper(results));
- }
abstract public void search(Weight weight, Filter filter, Collector results) throws IOException;
abstract public void close() throws IOException;
abstract public int docFreq(Term term) throws IOException;
Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermScorer.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TermScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermScorer.java Tue Oct 13 14:28:01 2009
@@ -65,20 +65,10 @@
scoreCache[i] = getSimilarity().tf(i) * weightValue;
}
- /** @deprecated use {@link #score(Collector)} instead. */
- public void score(HitCollector hc) throws IOException {
- score(new HitCollectorWrapper(hc));
- }
-
public void score(Collector c) throws IOException {
score(c, Integer.MAX_VALUE, nextDoc());
}
- /** @deprecated use {@link #score(Collector, int, int)} instead. */
- protected boolean score(HitCollector c, int end) throws IOException {
- return score(new HitCollectorWrapper(c), end, doc);
- }
-
// firstDocID is ignored since nextDoc() sets 'doc'
protected boolean score(Collector c, int end, int firstDocID) throws IOException {
c.setScorer(this);
@@ -166,8 +156,6 @@
}
/** Returns an explanation of the score for a document.
- * <br>When this method is used, the {@link #next()} method
- * and the {@link #score(HitCollector)} method should not be used.
* @param doc The document number for the explanation.
*/
public Explanation explain(int doc) throws IOException {
Modified: lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java?rev=824781&r1=824780&r2=824781&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java Tue Oct 13 14:28:01 2009
@@ -420,19 +420,10 @@
checkExplanations(query);
return super.search(query,filter,n,sort);
}
- /** @deprecated use {@link #search(Query, Collector)} instead. */
- public void search(Query query, HitCollector results) throws IOException {
- search(query, new HitCollectorWrapper(results));
- }
public void search(Query query, Collector results) throws IOException {
checkExplanations(query);
super.search(query, results);
}
- /** @deprecated use {@link #search(Query, Filter, Collector)} instead. */
- public void search(Query query, Filter filter,
- HitCollector results) throws IOException {
- search(query, filter, new HitCollectorWrapper(results));
- }
public void search(Query query, Filter filter, Collector results) throws IOException {
checkExplanations(query);
super.search(query, filter, results);
Re: svn commit: r824781 - in /lucene/java/trunk: ./ contrib/memory/src/java/org/apache/lucene/index/memory/
contrib/memory/src/test/org/apache/lucene/index/memory/ contrib/remote/src/java/org/apache/lucene/search/
contrib/surround/src/test/org/apache/luce
Posted by Michael Busch <bu...@gmail.com>.
Right. I was confused about that too.
Michael
On 10/13/09 9:43 AM, Uwe Schindler wrote:
> I think this was a mistake. Especially because the hint to the replacement
> method is the method itself.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Michael Busch [mailto:buschmic@gmail.com]
>> Sent: Tuesday, October 13, 2009 6:42 PM
>> To: java-dev@lucene.apache.org
>> Subject: Re: svn commit: r824781 - in /lucene/java/trunk: ./
>> contrib/memory/src/java/org/apache/lucene/index/memory/
>> contrib/memory/src/test/org/apache/lucene/index/memory/
>> contrib/remote/src/java/org/apache/lucene/search/
>> contrib/surround/src/test/org/apache/luce
>>
>> On 10/13/09 7:28 AM, uschindler@apache.org wrote:
>>
>>> @@ -115,7 +95,6 @@
>>> *<p>Applications should usually call {@link Searcher#search(Query)}
>>>
>> or
>>
>>> * {@link Searcher#search(Query,Filter)} instead.
>>> * @throws BooleanQuery.TooManyClauses
>>> - * @deprecated use {@link #search(Weight, Filter, int)} instead.
>>> */
>>> TopDocs search(Weight weight, Filter filter, int n) throws
>>>
>> IOException;
>>
>>>
>> Was this method just accidentally deprecated?
>>
>> Michael
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-dev-help@lucene.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
RE: svn commit: r824781 - in /lucene/java/trunk: ./ contrib/memory/src/java/org/apache/lucene/index/memory/ contrib/memory/src/test/org/apache/lucene/index/memory/ contrib/remote/src/java/org/apache/lucene/search/ contrib/surround/src/test/org/apache/luce
Posted by Uwe Schindler <uw...@thetaphi.de>.
I think this was a mistake. Especially because the hint to the replacement
method is the method itself.
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Michael Busch [mailto:buschmic@gmail.com]
> Sent: Tuesday, October 13, 2009 6:42 PM
> To: java-dev@lucene.apache.org
> Subject: Re: svn commit: r824781 - in /lucene/java/trunk: ./
> contrib/memory/src/java/org/apache/lucene/index/memory/
> contrib/memory/src/test/org/apache/lucene/index/memory/
> contrib/remote/src/java/org/apache/lucene/search/
> contrib/surround/src/test/org/apache/luce
>
> On 10/13/09 7:28 AM, uschindler@apache.org wrote:
> > @@ -115,7 +95,6 @@
> > *<p>Applications should usually call {@link Searcher#search(Query)}
> or
> > * {@link Searcher#search(Query,Filter)} instead.
> > * @throws BooleanQuery.TooManyClauses
> > - * @deprecated use {@link #search(Weight, Filter, int)} instead.
> > */
> > TopDocs search(Weight weight, Filter filter, int n) throws
> IOException;
> >
>
> Was this method just accidentally deprecated?
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: svn commit: r824781 - in /lucene/java/trunk: ./ contrib/memory/src/java/org/apache/lucene/index/memory/
contrib/memory/src/test/org/apache/lucene/index/memory/ contrib/remote/src/java/org/apache/lucene/search/
contrib/surround/src/test/org/apache/lucen...
Posted by Michael Busch <bu...@gmail.com>.
On 10/13/09 7:28 AM, uschindler@apache.org wrote:
> @@ -115,7 +95,6 @@
> *<p>Applications should usually call {@link Searcher#search(Query)} or
> * {@link Searcher#search(Query,Filter)} instead.
> * @throws BooleanQuery.TooManyClauses
> - * @deprecated use {@link #search(Weight, Filter, int)} instead.
> */
> TopDocs search(Weight weight, Filter filter, int n) throws IOException;
>
Was this method just accidentally deprecated?
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org