mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-17 02:15:22 +00:00
wip
This commit is contained in:
parent
f0a8659653
commit
710fb3bd89
@ -913,7 +913,7 @@ public abstract class BaseConfig {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public IndexNamePrefixLayoutStrategy indexNamePrefixLayoutStrategy() {
|
||||
public IndexNamePrefixLayoutStrategy indexLayoutStrategy() {
|
||||
return new IndexNamePrefixLayoutStrategy();
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,8 @@ import java.util.regex.Pattern;
|
||||
@Service
|
||||
public class IndexNamePrefixLayoutStrategy implements IndexLayoutStrategy {
|
||||
|
||||
// @Autowired
|
||||
// private DaoConfig myDaoConfig;
|
||||
@Autowired
|
||||
private DaoConfig myDaoConfig;
|
||||
|
||||
static final Log log = (Log) LoggerFactory.make(Log.class, MethodHandles.lookup());
|
||||
public static final String NAME = "prefix";
|
||||
@ -40,9 +40,9 @@ public class IndexNamePrefixLayoutStrategy implements IndexLayoutStrategy {
|
||||
}
|
||||
|
||||
private String addPrefixIfNecessary(String theCandidateName) {
|
||||
String myDaoConfig = "zoop";
|
||||
if (!StringUtils.isBlank(myDaoConfig)) {
|
||||
return myDaoConfig + "-" + theCandidateName;
|
||||
|
||||
if (!StringUtils.isBlank(myDaoConfig.getElasticSearchIndexPrefix())) {
|
||||
return myDaoConfig.getElasticSearchIndexPrefix() + "-" + theCandidateName;
|
||||
} else {
|
||||
return theCandidateName;
|
||||
}
|
||||
@ -63,9 +63,8 @@ public class IndexNamePrefixLayoutStrategy implements IndexLayoutStrategy {
|
||||
}
|
||||
|
||||
private String removePrefixIfNecessary(String theCandidateUniqueKey) {
|
||||
String myDaoConfig = "zoop";
|
||||
if (!StringUtils.isBlank(myDaoConfig)) {
|
||||
return theCandidateUniqueKey.replace(myDaoConfig+ "-", "");
|
||||
if (!StringUtils.isBlank(myDaoConfig.getElasticSearchIndexPrefix())) {
|
||||
return theCandidateUniqueKey.replace(myDaoConfig.getElasticSearchIndexPrefix() + "-", "");
|
||||
} else {
|
||||
return theCandidateUniqueKey;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
import org.testcontainers.elasticsearch.ElasticsearchContainer;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user