private static sbyte DocValuesByte(DocValuesType_e? type) { if (type == null) { return 0; } else if (type == DocValuesType_e.NUMERIC) { return 1; } else if (type == DocValuesType_e.BINARY) { return 2; } else if (type == DocValuesType_e.SORTED) { return 3; } else if (type == DocValuesType_e.SORTED_SET) { return 4; } else { throw new InvalidOperationException(); } }
/// <summary> /// Sole Constructor. /// /// @lucene.experimental /// </summary> public FieldInfo(string name, bool indexed, int number, bool storeTermVector, bool omitNorms, bool storePayloads, IndexOptions? indexOptions, DocValuesType_e? docValues, DocValuesType_e? normsType, IDictionary<string, string> attributes) { this.Name = name; this.indexed = indexed; this.Number = number; this.docValueType = docValues; if (indexed) { this.StoreTermVector = storeTermVector; this.StorePayloads = storePayloads; this.OmitNorms = omitNorms; this.IndexOptionsValue = indexOptions; this.NormTypeValue = !omitNorms ? normsType : null; } // for non-indexed fields, leave defaults else { this.StoreTermVector = false; this.StorePayloads = false; this.OmitNorms = false; this.IndexOptionsValue = null; this.NormTypeValue = null; } this.Attributes_Renamed = attributes; Debug.Assert(CheckConsistency()); }
/// <summary> /// 4.0-style docvalues byte </summary> public virtual sbyte DocValuesByte(DocValuesType_e? type, string legacyTypeAtt) { if (type == null) { Debug.Assert(legacyTypeAtt == null); return 0; } else { Debug.Assert(legacyTypeAtt != null); return (sbyte)LegacyDocValuesType.ordinalLookup[legacyTypeAtt]; } }