better logging on missing format, and allow to configure format on a type on the index level

This commit is contained in:
Shay Banon 2013-01-22 15:49:52 +01:00
parent 09cc70b8c9
commit 27bfb341ff
1 changed files with 10 additions and 0 deletions

View File

@ -121,6 +121,16 @@ public class IndexFieldDataService extends AbstractIndexComponent {
IndexFieldData.Builder builder = null;
if (type.getFormat() != null) {
builder = buildersByTypeAndFormat.get(Tuple.tuple(type.getType(), type.getFormat()));
if (builder == null) {
logger.warn("failed to find format [" + type.getFormat() + "] for field [" + fieldNames.fullName() + "], will use default");
}
}
String format = indexSettings.get("index.fielddata.type." + type.getType() + ".format", null);
if (format != null) {
builder = buildersByTypeAndFormat.get(Tuple.tuple(type.getType(), type.getFormat()));
if (builder == null) {
logger.warn("failed to find index level type format [" + format + "] for field [" + fieldNames.fullName() + "], will use default");
}
}
if (builder == null) {
builder = buildersByType.get(type.getType());