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
| Property | Returns | Description |
|---|---|---|
| builders | Map<String,ESMappingsBuilder> | The field mappings builders registered so far, keyed by database document type. |
| databaseName | String | The name of the database these mappings apply to. |
| databaseTypes | List<String> | The database document types these mappings apply to. |
| mappingsFn | String | The 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.
| Parameter | Description |
|---|---|
databaseName | the 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.
| Parameter | Description |
|---|---|
databaseTypes | the 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.
| Parameter | Description |
|---|---|
databaseTypes | the 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.
| Parameter | Description |
|---|---|
type | the database type the builder applies to |
builder | the 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.
| Parameter | Description |
|---|---|
mappingsFn | the 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.