@Override
 public void stringField(FieldInfo fieldInfo, String value) throws IOException {
   if (UidFieldMapper.NAME.equals(fieldInfo.name)) {
     uid = Uid.createUid(value);
   } else {
     addValue(fieldInfo.name, value);
   }
 }
Exemplo n.º 2
0
 @Override
 public void stringField(FieldInfo fieldInfo, byte[] bytes) throws IOException {
   final String value = new String(bytes, StandardCharsets.UTF_8);
   if (UidFieldMapper.NAME.equals(fieldInfo.name)) {
     uid = Uid.createUid(value);
   } else {
     addValue(fieldInfo.name, value);
   }
 }
Exemplo n.º 3
0
  @Override
  public Status needsField(FieldInfo fieldInfo) throws IOException {
    if (loadAllFields) {
      return Status.YES;
    }
    if (loadSource && SourceFieldMapper.NAME.equals(fieldInfo.name)) {
      return Status.YES;
    }
    if (UidFieldMapper.NAME.equals(fieldInfo.name)) {
      return Status.YES;
    }

    return fields.contains(fieldInfo.name) ? Status.YES : Status.NO;
  }
 @Override
 public boolean apply(String s) {
   return UidFieldMapper.NAME.equals(s);
 }