コード例 #1
0
 @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;
 }
コード例 #2
0
 @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;
 }
コード例 #3
0
 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)));
     }
   }
 }