-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix LineLength Check Suppressions: index.mapper #35087
Fix LineLength Check Suppressions: index.mapper #35087
Conversation
Pinging @elastic/es-core-infra |
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
assertNotNull(update); | ||
// original mapping not modified | ||
assertEquals(mapping, serialize(mapper)); | ||
// but we have an update | ||
assertEquals(Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties") | ||
.startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz").field("type", "text") | ||
.startObject("fields").startObject("keyword").field("type", "keyword").field("ignore_above", 256).endObject() | ||
.startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz") |
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.
I tend to try an indent these manually so they look a little more like json. Not that this is required, but it does help when they get big like this.
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.
But this one is actually pretty huge. I don't think it'd fit!
.startObject() | ||
.field("field", "value") | ||
.startArray("nested1") | ||
.startObject().field("field1", "1").startArray("nested2").startObject().field("field2", "2").endObject().startObject().field("field2", "3").endObject().endArray().endObject() | ||
.startObject().field("field1", "4").startArray("nested2").startObject().field("field2", "5").endObject().startObject().field("field2", "6").endObject().endArray().endObject() | ||
.startObject().field("field1", "1").startArray("nested2") |
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.
👍
.endObject() | ||
.endObject()); | ||
String mapping = Strings.toString(XContentFactory.jsonBuilder() | ||
.startObject() |
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.
❤️
Relates elastic#34884, backport of elastic#35087 (cherry picked from commit be75b40)
Fix linelength suppressions in index.mapper
Relates #34884