public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) { return getForField(fieldType, index().getName()); }
@SuppressWarnings("unchecked") public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType, String fullyQualifiedIndexName) { final String fieldName = fieldType.name(); IndexFieldData.Builder builder = fieldType.fielddataBuilder(fullyQualifiedIndexName); IndexFieldDataCache cache; synchronized (this) { cache = fieldDataCaches.get(fieldName); if (cache == null) { String cacheType = indexSettings.getValue(INDEX_FIELDDATA_CACHE_KEY); if (FIELDDATA_CACHE_VALUE_NODE.equals(cacheType)) { cache = indicesFieldDataCache.buildIndexFieldDataCache(listener, index(), fieldName); } else if ("none".equals(cacheType)){ cache = new IndexFieldDataCache.None(); } else { throw new IllegalArgumentException("cache type not supported [" + cacheType + "] for field [" + fieldName + "]"); } fieldDataCaches.put(fieldName, cache); } } return (IFD) builder.build(indexSettings, fieldType, cache, circuitBreakerService, mapperService); }
public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) { return getForField(fieldType, index().getName()); }
public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) { return getForField(fieldType, index().getName()); }
@SuppressWarnings("unchecked") public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType, String fullyQualifiedIndexName) { final String fieldName = fieldType.name(); IndexFieldData.Builder builder = fieldType.fielddataBuilder(fullyQualifiedIndexName); IndexFieldDataCache cache; synchronized (this) { cache = fieldDataCaches.get(fieldName); if (cache == null) { String cacheType = indexSettings.getValue(INDEX_FIELDDATA_CACHE_KEY); if (FIELDDATA_CACHE_VALUE_NODE.equals(cacheType)) { cache = indicesFieldDataCache.buildIndexFieldDataCache(listener, index(), fieldName); } else if ("none".equals(cacheType)){ cache = new IndexFieldDataCache.None(); } else { throw new IllegalArgumentException("cache type not supported [" + cacheType + "] for field [" + fieldName + "]"); } fieldDataCaches.put(fieldName, cache); } } return (IFD) builder.build(indexSettings, fieldType, cache, circuitBreakerService, mapperService); }
@SuppressWarnings("unchecked") public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType, String fullyQualifiedIndexName) { final String fieldName = fieldType.name(); IndexFieldData.Builder builder = fieldType.fielddataBuilder(fullyQualifiedIndexName); IndexFieldDataCache cache; synchronized (this) { cache = fieldDataCaches.get(fieldName); if (cache == null) { String cacheType = indexSettings.getValue(INDEX_FIELDDATA_CACHE_KEY); if (FIELDDATA_CACHE_VALUE_NODE.equals(cacheType)) { cache = indicesFieldDataCache.buildIndexFieldDataCache(listener, index(), fieldName); } else if ("none".equals(cacheType)){ cache = new IndexFieldDataCache.None(); } else { throw new IllegalArgumentException("cache type not supported [" + cacheType + "] for field [" + fieldName + "]"); } fieldDataCaches.put(fieldName, cache); } } return (IFD) builder.build(indexSettings, fieldType, cache, circuitBreakerService, mapperService); }
@SuppressWarnings("unchecked") public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) { final String fieldName = fieldType.name(); IndexFieldData.Builder builder = fieldType.fielddataBuilder(); IndexFieldDataCache cache; synchronized (this) { cache = fieldDataCaches.get(fieldName); if (cache == null) { String cacheType = indexSettings.getValue(INDEX_FIELDDATA_CACHE_KEY); if (FIELDDATA_CACHE_VALUE_NODE.equals(cacheType)) { cache = indicesFieldDataCache.buildIndexFieldDataCache(listener, index(), fieldName); } else if ("none".equals(cacheType)){ cache = new IndexFieldDataCache.None(); } else { throw new IllegalArgumentException("cache type not supported [" + cacheType + "] for field [" + fieldName + "]"); } fieldDataCaches.put(fieldName, cache); } } return (IFD) builder.build(indexSettings, fieldType, cache, circuitBreakerService, mapperService); }