Skip to content

Conversation

@vladimirdolzhenko
Copy link
Contributor

Fix linelength suppressions in index.mapper

Relates #34884

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

LGTM

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")
Copy link
Member

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.

Copy link
Member

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!

.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")
Copy link
Member

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()
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@vladimirdolzhenko vladimirdolzhenko merged commit be75b40 into elastic:master Oct 30, 2018
vladimirdolzhenko added a commit to vladimirdolzhenko/elasticsearch that referenced this pull request Oct 31, 2018
vladimirdolzhenko added a commit that referenced this pull request Oct 31, 2018
@vladimirdolzhenko vladimirdolzhenko deleted the linelength_cleanup_mapper branch October 31, 2018 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants