Apache Lucene open-source search software
remove obsolete scorer methods, add @Override
Yonik Seeley5bdde9b1d350
diff --git a/solr/src/java/org/apache/solr/search/function/FunctionQuery.java b/solr/src/java/org/apache/solr/search/function/FunctionQuery.javaindex a37880412d4..f34830f92d9 100644--- a/solr/src/java/org/apache/solr/search/function/FunctionQuery.java+++ b/solr/src/java/org/apache/solr/search/function/FunctionQuery.java@@ -51,10 +51,12 @@ public class FunctionQuery extends Query {return func;}+ @Overridepublic Query rewrite(IndexReader reader) throws IOException {return this;}+ @Overridepublic void extractTerms(Set terms) {}protected class FunctionWeight extends Weight {@@ -69,10 +71,12 @@ public class FunctionQuery extends Query {func.createWeight(context, searcher);}+ @Overridepublic Query getQuery() {return FunctionQuery.this;}+ @Overridepublic float getValue() {return queryWeight;}@@ -132,11 +136,11 @@ public class FunctionQuery extends Query {return doc;}- @Override// instead of matching all docs, we could also embed a query.// the score could either ignore the subscore, or boost it.// Containment: floatline(foo:myTerm, "myFloatField", 1.0, 0.0f)// Boost: foo:myTerm^floatline("myFloatField",1.0,0.0f)+ @Overridepublic int nextDoc() throws IOException {for(;;) {++doc;@@ -155,29 +159,7 @@ public class FunctionQuery extends Query {return nextDoc();}- // instead of matching all docs, we could also embed a query.- // the score could either ignore the subscore, or boost it.- // Containment: floatline(foo:myTerm, "myFloatField", 1.0, 0.0f)- // Boost: foo:myTerm^floatline("myFloatField",1.0,0.0f)- public boolean next() throws IOException {- for(;;) {- ++doc;- if (doc>=maxDoc) {- return false;- }- if (hasDeletions && delDocs.get(doc)) continue;- // todo: maybe allow score() to throw a specific exception- // and continue on to the next document if it is thrown...- // that may be useful, but exceptions aren't really good- // for flow control.- return true;- }- }-- public int doc() {- return doc;- }-+ @Overridepublic float score() throws IOException {float score = qWeight * vals.floatVal(doc);@@ -187,11 +169,6 @@ public class FunctionQuery extends Query {return score>Float.NEGATIVE_INFINITY ? score : -Float.MAX_VALUE;}- public boolean skipTo(int target) throws IOException {- doc=target-1;- return next();- }-public Explanation explain(int doc) throws IOException {float sc = qWeight * vals.floatVal(doc);@@ -206,12 +183,14 @@ public class FunctionQuery extends Query {}+ @Overridepublic Weight createWeight(Searcher searcher) throws IOException {return new FunctionQuery.FunctionWeight(searcher);}/** Prints a user-readable version of this query. */+ @Overridepublic String toString(String field){float boost = getBoost();@@ -221,6 +200,7 @@ public class FunctionQuery extends Query {/** Returns true if <code>o</code> is equal to this. */+ @Overridepublic boolean equals(Object o) {if (FunctionQuery.class != o.getClass()) return false;FunctionQuery other = (FunctionQuery)o;@@ -229,6 +209,7 @@ public class FunctionQuery extends Query {}/** Returns a hash code value for this object. */+ @Overridepublic int hashCode() {return func.hashCode()*31 + Float.floatToIntBits(getBoost());}