question: public CreateIndexRequest mapping ( String type , XContentBuilder source ) { if ( mappings . containsKey ( type ) ) { throw new IllegalStateException ( "mappings for type \"" + type + "\" were already defined" ) ; } try { mappings . put ( type , source . string ( ) ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( "Failed to build json for mapping request" , e ) ; } return this ; }
target:  Adds mapping that will be added when the index gets created.