Skip to content

Commit 7369c4d

Browse files
unknownMpdreamz
authored andcommitted
Multifield example
1 parent 29fd2c8 commit 7369c4d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

new_docs/contents/nest/indices/put-mapping.markdown

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,20 @@ You can also create mappings on the fly:
8585

8686
typeMapping.Properties.Add("name", property);
8787
this.ConnectedClient.Map(typeMapping);
88+
89+
## Multifield Mapping
90+
To create multifield type you can use following example.
91+
92+
var result = this._client.Map<ElasticsearchProject>(m => m
93+
.Properties(props => props
94+
.MultiField(s => s
95+
.Name(p => p.Name)
96+
.Path(MultiFieldMappingPath.Full)
97+
.Fields(pprops => pprops
98+
.String(ps => ps.Name(p => p.Name).Index(FieldIndexOption.not_analyzed))
99+
.String(ps => ps.Name(p => p.Name.Suffix("searchable")).Index(FieldIndexOption.analyzed))
100+
)
101+
))
102+
);
103+
104+

0 commit comments

Comments
 (0)