.field("field2", "value2")
.endObject().bytes());
FieldNameAnalyzer analyzer = (FieldNameAnalyzer) doc.analyzer();
assertThat(((NamedAnalyzer) analyzer.defaultAnalyzer()).name(), equalTo("whitespace"));
assertThat(((NamedAnalyzer) analyzer.analyzers().get("field1")), nullValue());
assertThat(((NamedAnalyzer) analyzer.analyzers().get("field2")).name(), equalTo("simple"));
// check that it serializes and de-serializes correctly
DocumentMapper reparsedMapper = parser.parse(documentMapper.mappingSource().string());