Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/client-concepts/high-level/mapping/auto-map.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ var descriptor = new CreateIndexDescriptor("myindex")
.Map<Company>(m => m
.Properties(ps => ps
.String(s => s
.Name(c => c.Name) <1>
.Name(c => c.Name) <1>
)
.Object<Employee>(o => o <2>
.Object<Employee>(o => o <2>
.Name(c => c.Employees)
.Properties(eps => eps
.String(s => s
Expand Down Expand Up @@ -250,7 +250,8 @@ various options for your properties (analyzer to use, whether to enable doc_valu
In that case, it's possible to use `.AutoMap()` in conjunction with explicitly mapped properties.

Here we are using `.AutoMap()` to automatically map our company type, but then we're
overriding our employee property and making it a `nested` type, since by default,`.AutoMap()` will infer objects as `object`.
overriding our employee property and making it a `nested` type, since by default,
`.AutoMap()` will infer objects as `object`.

[source,csharp]
----
Expand Down Expand Up @@ -916,7 +917,7 @@ It is also possible to apply a transformation on all or specific properties.
`.AutoMap()` internally implements the https://en.wikipedia.org/wiki/Visitor_pattern[visitor pattern]. The default visitor, `NoopPropertyVisitor`,
does nothing and acts as a blank canvas for you to implement your own visiting methods.

For instance, lets create a custom visitor that disables doc values for numeric and boolean types
For instance, let's create a custom visitor that disables doc values for numeric and boolean types
(Not really a good idea in practice, but let's do it anyway for the sake of a clear example.)

[source,csharp]
Expand All @@ -926,15 +927,15 @@ public class DisableDocValuesPropertyVisitor : NoopPropertyVisitor
public override void Visit(
INumberProperty type,
PropertyInfo propertyInfo,
ElasticsearchPropertyAttributeBase attribute) <1>
ElasticsearchPropertyAttributeBase attribute) <1>
{
type.DocValues = false;
}

public override void Visit(
IBooleanProperty type,
PropertyInfo propertyInfo,
ElasticsearchPropertyAttributeBase attribute) <2>
ElasticsearchPropertyAttributeBase attribute) <2>
{
type.DocValues = false;
}
Expand Down