v1.0.0, the MappingBuilder model provides a fluent closure-based sytax for defining and mapping indexes. This builder can be accessed by injecting it into your components:
newmethod of the
IndexBuilderalso accepts a closure as the second (
properties) argument. If a closure is passed, a
MappingBuilderinstance is passed as an argument to the closure:
MappingBuilderhas one primary method:
createtakes a callback with a
MappingBlueprintobject, usually aliased as
MappingBlueprintgives a fluent api to defining a mapping. It has methods for all the ElasticSearch mapping types:
objectexpects a closure which will be provided another
MappingBlueprint. The results will be set as the
onMissingMethodand will use the method name (as snake case) as the parameter name and the first argument passed as the parameter value.
You can also add parameters using the
addParameter( string name, any value )or
setParameters( struct map )methods.
fieldswhich expects a closure argument and allows you to create multiple field definitions for a mapping.
usermapping that gets repeated for managers as well.