-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Migrate some more mapper test cases #61507
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
Conversation
Migrate some more mapper test cases from `ESSingleNodeTestCase` to `MapperTestCase`.
Pinging @elastic/es-search (:Search/Mapping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @nik9000!
protected Collection<Class<? extends Plugin>> getPlugins() { | ||
return pluginList(MapperExtrasPlugin.class); | ||
protected boolean supportsMeta() { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A useful byproduct of this exercise is finding all the mappers that we've forgotten to implement meta
on!
|
||
@Override | ||
protected void metaMapping(XContentBuilder b) throws IOException { | ||
// We serialize extra fields on top of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment looks truncated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
for (String field : new String[] { "a_field", "a_field._index_prefix", "a_field._2gram", "a_field._3gram"}) { | ||
DocumentMapper mapper = createDocumentMapper(fieldMapping(this::minimalMapping)); | ||
ParsedDocument doc = mapper.parse(source(b -> b.field("field", "new york city"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ so much nicer
@@ -17,7 +17,6 @@ | |||
* under the License. | |||
*/ | |||
apply plugin: 'elasticsearch.yaml-rest-test' | |||
apply plugin: 'elasticsearch.internal-cluster-test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -205,35 +222,39 @@ protected boolean supportsMeta() { | |||
return true; | |||
} | |||
|
|||
protected void metaMapping(XContentBuilder b) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pain, and the really annoying thing is that it's hard to fix these inconsistencies because of BWC. I need to think some more about it.
run elasticsearch-ci/packaging-sample-unix |
Migrate some more mapper test cases from `ESSingleNodeTestCase` to `MapperTestCase`.
Migrate some more mapper test cases from
ESSingleNodeTestCase
toMapperTestCase
.