|
20 | 20 | package org.elasticsearch.index.mapper;
|
21 | 21 |
|
22 | 22 | import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
23 |
| - |
24 | 23 | import org.apache.lucene.document.Document;
|
25 | 24 | import org.apache.lucene.document.FloatPoint;
|
26 | 25 | import org.apache.lucene.document.HalfFloatPoint;
|
|
37 | 36 | import org.apache.lucene.search.Query;
|
38 | 37 | import org.apache.lucene.store.Directory;
|
39 | 38 | import org.apache.lucene.util.BytesRef;
|
40 |
| -import org.elasticsearch.core.internal.io.IOUtils; |
41 | 39 | import org.apache.lucene.util.TestUtil;
|
| 40 | +import org.elasticsearch.core.internal.io.IOUtils; |
42 | 41 | import org.elasticsearch.index.mapper.MappedFieldType.Relation;
|
43 | 42 | import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType;
|
| 43 | +import org.elasticsearch.index.mapper.NumberFieldMapper.NumberFieldType; |
44 | 44 | import org.hamcrest.Matchers;
|
45 | 45 | import org.junit.Before;
|
46 | 46 |
|
@@ -68,6 +68,17 @@ protected MappedFieldType createDefaultFieldType() {
|
68 | 68 | return new NumberFieldMapper.NumberFieldType(type);
|
69 | 69 | }
|
70 | 70 |
|
| 71 | + public void testEqualsWithDifferentNumberTypes() { |
| 72 | + NumberType type = randomFrom(NumberType.values()); |
| 73 | + NumberFieldType fieldType = new NumberFieldType(type); |
| 74 | + |
| 75 | + NumberType otherType = randomValueOtherThan(type, |
| 76 | + () -> randomFrom(NumberType.values())); |
| 77 | + NumberFieldType otherFieldType = new NumberFieldType(otherType); |
| 78 | + |
| 79 | + assertNotEquals(fieldType, otherFieldType); |
| 80 | + } |
| 81 | + |
71 | 82 | public void testIsFieldWithinQuery() throws IOException {
|
72 | 83 | MappedFieldType ft = createDefaultFieldType();
|
73 | 84 | // current impl ignores args and should always return INTERSECTS
|
|
0 commit comments