Apache Lucene open-source search software
remove obsolete scorer methods, add @Override
Yonik Seeleyd46262e37311
diff --git a/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java b/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.javaindex e4ea5e03079..efb341b1da8 100755--- a/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java+++ b/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java@@ -66,28 +66,34 @@ public class SolrConstantScoreQuery extends ConstantScoreQuery {((SolrFilter)filter).createWeight(context, searcher);}+ @Overridepublic Query getQuery() {return SolrConstantScoreQuery.this;}+ @Overridepublic float getValue() {return queryWeight;}+ @Overridepublic float sumOfSquaredWeights() throws IOException {queryWeight = getBoost();return queryWeight * queryWeight;}+ @Overridepublic void normalize(float norm) {this.queryNorm = norm;queryWeight *= this.queryNorm;}+ @Overridepublic Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {return new ConstantScorer(similarity, reader, this);}+ @Overridepublic Explanation explain(IndexReader reader, int doc) throws IOException {ConstantScorer cs = new ConstantScorer(similarity, reader, this);@@ -133,27 +139,28 @@ public class SolrConstantScoreQuery extends ConstantScoreQuery {}}+ @Overridepublic int nextDoc() throws IOException {return docIdSetIterator.nextDoc();}+ @Overridepublic int docID() {return docIdSetIterator.docID();}+ @Overridepublic float score() throws IOException {return theScore;}+ @Overridepublic int advance(int target) throws IOException {return docIdSetIterator.advance(target);}-- public Explanation explain(int doc) throws IOException {- throw new UnsupportedOperationException();- }}+ @Overridepublic Weight createWeight(Searcher searcher) {try {return new SolrConstantScoreQuery.ConstantWeight(searcher);@@ -164,12 +171,14 @@ public class SolrConstantScoreQuery extends ConstantScoreQuery {}/** Prints a user-readable version of this query. */+ @Overridepublic String toString(String field) {return "ConstantScore(" + filter.toString()+ (getBoost()==1.0 ? ")" : "^" + getBoost());}/** Returns true if <code>o</code> is equal to this. */+ @Overridepublic boolean equals(Object o) {if (this == o) return true;if (!(o instanceof SolrConstantScoreQuery)) return false;@@ -178,6 +187,7 @@ public class SolrConstantScoreQuery extends ConstantScoreQuery {}/** Returns a hash code value for this object. */+ @Overridepublic int hashCode() {// Simple add is OK since no existing filter hashcode has a float component.return filter.hashCode() + Float.floatToIntBits(getBoost());