@Configuration public class ElasticsearchConfigurationSupport extends Object
Constructor and Description |
---|
ElasticsearchConfigurationSupport() |
Modifier and Type | Method and Description |
---|---|
ElasticsearchCustomConversions |
elasticsearchCustomConversions()
Register custom
Converter s in a ElasticsearchCustomConversions object if required. |
ElasticsearchConverter |
elasticsearchEntityMapper(SimpleElasticsearchMappingContext elasticsearchMappingContext) |
SimpleElasticsearchMappingContext |
elasticsearchMappingContext()
Creates a
SimpleElasticsearchMappingContext equipped with entity classes scanned from the mapping base
package. |
protected Set<Class<?>> |
getInitialEntitySet()
Scans the mapping base package for classes annotated with
Document . |
protected Collection<String> |
getMappingBasePackages()
Returns the base packages to scan for Elasticsearch mapped entities at startup.
|
protected Set<Class<?>> |
scanForEntities(String basePackage)
Scans the given base package for entities, i.e.
|
@Bean public ElasticsearchConverter elasticsearchEntityMapper(SimpleElasticsearchMappingContext elasticsearchMappingContext)
@Bean public SimpleElasticsearchMappingContext elasticsearchMappingContext()
SimpleElasticsearchMappingContext
equipped with entity classes scanned from the mapping base
package.getMappingBasePackages()
@Bean public ElasticsearchCustomConversions elasticsearchCustomConversions()
Converter
s in a ElasticsearchCustomConversions
object if required.protected Collection<String> getMappingBasePackages()
com.acme.AppConfig
extending ElasticsearchConfigurationSupport
the base package will be considered
com.acme
unless the method is overridden to implement alternate behavior.Document
classes or an empty collection to not enable scanning
for entities.protected Set<Class<?>> getInitialEntitySet() throws ClassNotFoundException
Document
. By default, it scans for entities in
all packages returned by getMappingBasePackages()
.ClassNotFoundException
getMappingBasePackages()
protected Set<Class<?>> scanForEntities(String basePackage) throws ClassNotFoundException
Document
and
Persistent
.basePackage
- must not be null.ClassNotFoundException
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.