|
@@ -31,7 +31,6 @@ import org.apache.lucene.store.Directory;
|
|
|
import org.apache.lucene.tests.search.RandomApproximationQuery;
|
|
|
import org.apache.lucene.util.Accountable;
|
|
|
import org.apache.lucene.util.BytesRef;
|
|
|
-import org.elasticsearch.ElasticsearchException;
|
|
|
import org.elasticsearch.common.lucene.search.function.CombineFunction;
|
|
|
import org.elasticsearch.common.lucene.search.function.FieldValueFactorFunction;
|
|
|
import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery;
|
|
@@ -944,7 +943,7 @@ public class FunctionScoreTests extends ESTestCase {
|
|
|
null,
|
|
|
Float.POSITIVE_INFINITY
|
|
|
);
|
|
|
- ElasticsearchException exc = expectThrows(ElasticsearchException.class, () -> localSearcher.search(query1, 1));
|
|
|
+ IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> localSearcher.search(query1, 1));
|
|
|
assertThat(exc.getMessage(), containsString("function score query returned an invalid score: " + Float.NaN));
|
|
|
FunctionScoreQuery query2 = new FunctionScoreQuery(
|
|
|
new TermQuery(new Term(FIELD, "out")),
|
|
@@ -953,7 +952,7 @@ public class FunctionScoreTests extends ESTestCase {
|
|
|
null,
|
|
|
Float.POSITIVE_INFINITY
|
|
|
);
|
|
|
- exc = expectThrows(ElasticsearchException.class, () -> localSearcher.search(query2, 1));
|
|
|
+ exc = expectThrows(IllegalArgumentException.class, () -> localSearcher.search(query2, 1));
|
|
|
assertThat(exc.getMessage(), containsString("function score query returned an invalid score: " + Float.NEGATIVE_INFINITY));
|
|
|
}
|
|
|
|