Now really fix eager fielddata loading.

Relates to #5557
This commit is contained in:
Martijn van Groningen 2014-03-27 13:52:57 +07:00
parent 5a0c1eb195
commit 22b13f5449
1 changed files with 12 additions and 5 deletions

View File

@ -767,15 +767,22 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
if (fieldDataType == null) {
continue;
}
final String indexName = fieldMapper.names().indexName();
if (fieldMapper instanceof ParentFieldMapper) {
ParentFieldMapper parentFieldMapper = (ParentFieldMapper) fieldMapper;
if (parentFieldMapper.active()) {
warmUp.put(indexName, parentFieldMapper);
if (!parentFieldMapper.active()) {
continue;
}
} else {
if (fieldDataType.getLoading() != Loading.EAGER) {
continue;
}
} else if (fieldDataType.getLoading() != Loading.EAGER && !warmUp.containsKey(indexName)) {
warmUp.put(indexName, fieldMapper);
}
final String indexName = fieldMapper.names().indexName();
if (warmUp.containsKey(indexName)) {
continue;
}
warmUp.put(indexName, fieldMapper);
}
}
final IndexFieldDataService indexFieldDataService = indexShard.indexFieldDataService();