Skip to content

Commit

Permalink
Improve index parameter testing for geo_point (#69414)
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase authored Mar 22, 2021
1 parent 86e1e25 commit 2437475
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
checker.registerConflictCheck("null_value", b -> b.field("null_value", "41.12,-71.34"));
checker.registerConflictCheck("doc_values", b -> b.field("doc_values", false));
checker.registerConflictCheck("store", b -> b.field("store", true));
checker.registerConflictCheck("index", b -> b.field("index", false));
}

@Override
Expand Down Expand Up @@ -192,6 +193,14 @@ public void testIgnoreZValue() throws IOException {
assertThat(ignoreZValue, equalTo(false));
}

public void testIndexParameter() throws Exception {
DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_point").field("index", false)));
Mapper fieldMapper = mapper.mappers().getMapper("field");
assertThat(fieldMapper, instanceOf(GeoPointFieldMapper.class));
boolean searchable = ((GeoPointFieldMapper)fieldMapper).fieldType().isSearchable();
assertThat(searchable, equalTo(false));
}

public void testMultiField() throws Exception {
DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> {
b.field("type", "geo_point").field("doc_values", false);
Expand Down

0 comments on commit 2437475

Please sign in to comment.