Skip to content

Commit 2437475

Browse files
authored
Improve index parameter testing for geo_point (#69414)
1 parent 86e1e25 commit 2437475

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
4646
checker.registerConflictCheck("null_value", b -> b.field("null_value", "41.12,-71.34"));
4747
checker.registerConflictCheck("doc_values", b -> b.field("doc_values", false));
4848
checker.registerConflictCheck("store", b -> b.field("store", true));
49+
checker.registerConflictCheck("index", b -> b.field("index", false));
4950
}
5051

5152
@Override
@@ -192,6 +193,14 @@ public void testIgnoreZValue() throws IOException {
192193
assertThat(ignoreZValue, equalTo(false));
193194
}
194195

196+
public void testIndexParameter() throws Exception {
197+
DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_point").field("index", false)));
198+
Mapper fieldMapper = mapper.mappers().getMapper("field");
199+
assertThat(fieldMapper, instanceOf(GeoPointFieldMapper.class));
200+
boolean searchable = ((GeoPointFieldMapper)fieldMapper).fieldType().isSearchable();
201+
assertThat(searchable, equalTo(false));
202+
}
203+
195204
public void testMultiField() throws Exception {
196205
DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> {
197206
b.field("type", "geo_point").field("doc_values", false);

0 commit comments

Comments
 (0)