com.shopizer.search.utils.DynamicIndexNameUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sm-search Show documentation
Show all versions of sm-search Show documentation
Search module for shopizer using elasticsearch 5.6.12
package com.shopizer.search.utils;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
public class DynamicIndexNameUtil {
@SuppressWarnings("rawtypes")
public static String getIndexName(String name, Map indexData) {
if (name.startsWith("%") && name.endsWith("%")) {
String containedField = name.substring(1, name.length() - 1);
String f = (String) indexData.get(containedField);
if (StringUtils.isBlank(f)) {
return name;
}
return f;
}
return name;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy