Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve index parameter testing for geo_point #69414

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Feb 23, 2021

In 7.9 a bug was introduced where the index parameter for geo_point field mapper was ignored. this was fixed by accident in 7.11 but the bug has remained unnoticed until now. This PR adds some more test so this should not happen again.

closes #69401

@iverase iverase added >test Issues or PRs that are addressing/adding tests :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.13.0 labels Feb 23, 2021
@iverase iverase requested a review from romseygeek February 23, 2021 09:25
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Feb 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@iverase iverase changed the title Improve index parameter Testing for geo_point Improve index parameter testing for geo_point Feb 23, 2021
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also check that parsing omits the right fields, as in KeywordFieldMapperTests#testDisableIndex().

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Now that all mappers are parametrized, I think it may be possible to add some extra checks that every parameter is tested in registerParameters

@iverase iverase merged commit 2437475 into elastic:master Mar 22, 2021
@iverase iverase deleted the indexParam branch March 22, 2021 13:54
iverase added a commit that referenced this pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With ES 7.10.2 unable to make geo_point field not-indexed (Regression from 7.5.2)
5 participants