@Override public PostingsFormat getPostingsFormatForField(String field) { final FieldMappers indexName = mapperService.indexName(field); if (indexName == null) { logger.warn("no index mapper found for field: [{}] returning default postings format", field); return defaultPostingFormat; } PostingsFormatProvider postingsFormat = indexName.mapper().postingsFormatProvider(); return postingsFormat != null ? postingsFormat.get() : defaultPostingFormat; }
@Override public DocValuesFormat getDocValuesFormatForField(String field) { final FieldMappers indexName = mapperService.indexName(field); if (indexName == null) { logger.warn( "no index mapper found for field: [{}] returning default doc values format", field); return defaultDocValuesFormat; } DocValuesFormatProvider docValuesFormat = indexName.mapper().docValuesFormatProvider(); return docValuesFormat != null ? docValuesFormat.get() : defaultDocValuesFormat; }
public void postProcess(MapperService mapperService) { if (uid != null) { DocumentMapper documentMapper = mapperService.documentMapper(uid.type()); if (documentMapper != null) { // we can derive the exact type for the mapping postProcess(documentMapper); return; } } // can't derive exact mapping type for (Map.Entry<String, List<Object>> entry : fields().entrySet()) { FieldMappers fieldMappers = mapperService.indexName(entry.getKey()); if (fieldMappers == null) { continue; } List<Object> fieldValues = entry.getValue(); for (int i = 0; i < fieldValues.size(); i++) { fieldValues.set(i, fieldMappers.mapper().valueForSearch(fieldValues.get(i))); } } }