@Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) { // Some leaf readers may be wrapped and report different set of fields and use the same cache key. // If a field can't be found then it doesn't mean it isn't there, // so if a field doesn't exist then we don't cache it and just return an empty field data instance. // The next time the field is found, we do cache. return empty(context.reader().maxDoc()); } try { FD fd = cache.load(context, this); return fd; } catch (Exception e) { if (e instanceof ElasticsearchException) { throw (ElasticsearchException) e; } else { throw new ElasticsearchException(e); } } }
@Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldNames.indexName()) == null) { // Some leaf readers may be wrapped and report different set of fields and use the same cache key. // If a field can't be found then it doesn't mean it isn't there, // so if a field doesn't exist then we don't cache it and just return an empty field data instance. // The next time the field is found, we do cache. return empty(context.reader().maxDoc()); } try { FD fd = cache.load(context, this); return fd; } catch (Throwable e) { if (e instanceof ElasticsearchException) { throw (ElasticsearchException) e; } else { throw new ElasticsearchException(e.getMessage(), e); } } }
@Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) { // Some leaf readers may be wrapped and report different set of fields and use the same cache key. // If a field can't be found then it doesn't mean it isn't there, // so if a field doesn't exist then we don't cache it and just return an empty field data instance. // The next time the field is found, we do cache. return empty(context.reader().maxDoc()); } try { FD fd = cache.load(context, this); return fd; } catch (Exception e) { if (e instanceof ElasticsearchException) { throw (ElasticsearchException) e; } else { throw new ElasticsearchException(e); } } }
@Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) { // Some leaf readers may be wrapped and report different set of fields and use the same cache key. // If a field can't be found then it doesn't mean it isn't there, // so if a field doesn't exist then we don't cache it and just return an empty field data instance. // The next time the field is found, we do cache. return empty(context.reader().maxDoc()); } try { FD fd = cache.load(context, this); return fd; } catch (Exception e) { if (e instanceof ElasticsearchException) { throw (ElasticsearchException) e; } else { throw new ElasticsearchException(e); } } }
@Override public FD load(LeafReaderContext context) { if (context.reader().getFieldInfos().fieldInfo(fieldName) == null) { // Some leaf readers may be wrapped and report different set of fields and use the same cache key. // If a field can't be found then it doesn't mean it isn't there, // so if a field doesn't exist then we don't cache it and just return an empty field data instance. // The next time the field is found, we do cache. return empty(context.reader().maxDoc()); } try { FD fd = cache.load(context, this); return fd; } catch (Exception e) { if (e instanceof ElasticsearchException) { throw (ElasticsearchException) e; } else { throw new ElasticsearchException(e); } } }