Search in sources :

Example 1 with Setting

use of org.springframework.data.elasticsearch.annotations.Setting in project spring-data-elasticsearch by spring-projects.

the class SimpleElasticsearchPersistentEntity method buildSettingsParameter.

private SettingsParameter buildSettingsParameter(Class<?> clazz) {
    SettingsParameter settingsParameter = new SettingsParameter();
    Document documentAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Document.class);
    Setting settingAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Setting.class);
    if (documentAnnotation != null) {
        settingsParameter.useServerConfiguration = documentAnnotation.useServerConfiguration();
        settingsParameter.shards = documentAnnotation.shards();
        settingsParameter.replicas = documentAnnotation.replicas();
        settingsParameter.refreshIntervall = documentAnnotation.refreshInterval();
        settingsParameter.indexStoreType = documentAnnotation.indexStoreType();
    }
    if (settingAnnotation != null) {
        processSettingAnnotation(settingAnnotation, settingsParameter);
    }
    return settingsParameter;
}
Also used : Setting(org.springframework.data.elasticsearch.annotations.Setting) Document(org.springframework.data.elasticsearch.annotations.Document)

Aggregations

Document (org.springframework.data.elasticsearch.annotations.Document)1 Setting (org.springframework.data.elasticsearch.annotations.Setting)1