Semantic field - generalize & improve field mapper unit tests#155003
Open
Mikep86 wants to merge 24 commits into
Open
Semantic field - generalize & improve field mapper unit tests#155003Mikep86 wants to merge 24 commits into
Mikep86 wants to merge 24 commits into
Conversation
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
More iterations on
semanticandsemantic_textfield mapper unit test generalizations & improvements. This is (more) groundwork for migrating the tests inSemanticTextFieldMapperTeststoAbstractSemanticMapperTestCase, so that they can apply to bothsemanticandsemantic_textfields.The theme of this round was reducing code duplication and creating canonical ways to perform common actions:
assertSemanticFieldimprovements: Improved this in a few ways:model_settings, when present. However, the embeddings sub-mapper is created eagerly, whenever the inference ID is resolvable through the model registry. In contrast,model_settingsis only set after first document ingest. This change materially improves test coverage by confirming that the embeddings sub-mapper is created and configured correctly, independent ofmodel_settings.model_settingsagainst the passed-in model.assertSemanticField, and it is clearer how to use the method.semanticMappinghelper methods.assertSemanticField.The net result is more test coverage with fewer lines of code, and a cleaner base to use to migrate tests to
AbstractSemanticMapperTestCase. Those migrations will start with the next follow-up PR 🚀Relates to #146592