Example #1
0
 private void AddShortsField(FieldInfo field, IndexOutput output, IEnumerable <long?> values)
 {
     field.PutAttribute(LegacyKey, LegacyDocValuesType.FIXED_INTS_16.Name);
     CodecUtil.WriteHeader(output, Lucene40DocValuesFormat.INTS_CODEC_NAME, Lucene40DocValuesFormat.INTS_VERSION_CURRENT);
     output.WriteInt(2); // size
     foreach (long?n in values)
     {
         output.WriteShort(n == null ? (short)0 : (short)n);
     }
 }