Fluent builder for declaring an app's Elasticsearch index mappings for one of its own databases. Obtained from ControllerMappingList.esMappingsController, chained with databaseName, dataTypes and builder calls, then finished with build to register the resulting mappings against the app so its documents are indexed with the declared field types.

Group: Builders


Properties

PropertyReturnsDescription
buildersMap<String,ESMappingsBuilder>The field mappings builders registered so far, keyed by database document type.
databaseNameStringThe name of the database these mappings apply to.
databaseTypesList<String>The database document types these mappings apply to.
mappingsFnStringThe name of the JavaScript function, if any, used to customise the generated mappings.

Methods

getDatabaseName() · databaseName(String databaseName) · getDatabaseTypes() · dataTypes(List<String> databaseTypes) · dataTypes(String databaseTypes) · builder(String type, ESMappingsBuilder builder) · getBuilders() · getMappingsFn() · mappingsFn(String mappingsFn) · build()

getDatabaseName()

Returns: String

The name of the database these mappings apply to.

databaseName(String databaseName)

Returns: RepoEsMappingsBuilder

Sets the name of the database these mappings apply to.

ParameterDescription
databaseNamethe target database's name

getDatabaseTypes()

Returns: List<String>

The database document types these mappings apply to.

dataTypes(List<String> databaseTypes)

Returns: RepoEsMappingsBuilder

Sets the database document types these mappings apply to, replacing any previously set types.

ParameterDescription
databaseTypesthe database type names to apply the mappings to

dataTypes(String databaseTypes)

Returns: RepoEsMappingsBuilder

Adds one or more database document types these mappings apply to, appending to any previously set types.

ParameterDescription
databaseTypesthe database type names to add

builder(String type, ESMappingsBuilder builder)

Returns: RepoEsMappingsBuilder

Registers the field mappings builder to use for the given database document type.

ParameterDescription
typethe database type the builder applies to
builderthe mappings builder that defines the field types for that document type

getBuilders()

Returns: Map<String,ESMappingsBuilder>

The field mappings builders registered so far, keyed by database document type.

getMappingsFn()

Returns: String

The name of the JavaScript function, if any, used to customise the generated mappings.

mappingsFn(String mappingsFn)

Returns: RepoEsMappingsBuilder

Sets the name of a JavaScript function used to customise the generated mappings.

ParameterDescription
mappingsFnthe name of the global JavaScript function to call

build()

Returns: void

Finishes this builder, registering the declared database name, types, field mappings builders and mappings function against the app so its Elasticsearch index can be built with these mappings.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.