mirror of https://github.com/apache/lucene.git
LUCENE-7213: fix test bug when LatLonPoint.newBoxQuery returns MatchNoDocsQuery.
This commit is contained in:
parent
d5cd3d6e2e
commit
1c8164f7c0
|
@ -54,6 +54,7 @@ import org.apache.lucene.index.SegmentWriteState;
|
||||||
import org.apache.lucene.index.SerialMergeScheduler;
|
import org.apache.lucene.index.SerialMergeScheduler;
|
||||||
import org.apache.lucene.index.Term;
|
import org.apache.lucene.index.Term;
|
||||||
import org.apache.lucene.search.IndexSearcher;
|
import org.apache.lucene.search.IndexSearcher;
|
||||||
|
import org.apache.lucene.search.MatchNoDocsQuery;
|
||||||
import org.apache.lucene.search.Query;
|
import org.apache.lucene.search.Query;
|
||||||
import org.apache.lucene.search.ScoreDoc;
|
import org.apache.lucene.search.ScoreDoc;
|
||||||
import org.apache.lucene.search.SimpleCollector;
|
import org.apache.lucene.search.SimpleCollector;
|
||||||
|
@ -1387,7 +1388,11 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
|
||||||
q1 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
|
q1 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
|
||||||
q2 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
|
q2 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
|
||||||
assertEquals(q1, q2);
|
assertEquals(q1, q2);
|
||||||
|
// for "impossible" ranges LatLonPoint.newBoxQuery will return MatchNoDocsQuery
|
||||||
|
// changing the field is unrelated to that.
|
||||||
|
if (q1 instanceof MatchNoDocsQuery == false) {
|
||||||
assertFalse(q1.equals(newRectQuery("field2", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon)));
|
assertFalse(q1.equals(newRectQuery("field2", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon)));
|
||||||
|
}
|
||||||
|
|
||||||
double lat = randomLat(false);
|
double lat = randomLat(false);
|
||||||
double lon = randomLon(false);
|
double lon = randomLon(false);
|
||||||
|
|
Loading…
Reference in New Issue