Section navigation

Public structRead-only StoredDocument

Namespace
Rowles.LeanCorpus.Mapping
Assembly
Rowles.LeanCorpus.dll

Snapshot of stored-field data for a single document, as returned by GetStoredFields(int) and GetStoredBinaryFields(int).

public readonly record struct StoredDocument : IEquatable<StoredDocument>
Implements

Public constructor StoredDocument(IReadOnlyDictionary<string, IReadOnlyList<string>>, IReadOnlyDictionary<string, IReadOnlyList<byte[]>>)

Snapshot of stored-field data for a single document, as returned by GetStoredFields(int) and GetStoredBinaryFields(int).

Public property BinaryFields

Binary stored-field values indexed by field name.

Public property Empty

An empty StoredDocument with no fields.

Public property Fields

String stored-field values indexed by field name.

Public method Create(IReadOnlyDictionary<string, IReadOnlyList<string>>?, IReadOnlyDictionary<string, IReadOnlyList<byte[]>>?)

Builds a StoredDocument from the supplied dictionaries. Null arguments are replaced with empty read-only dictionaries.

Public method GetFirst(string)

Returns the first string value for the named field, or null when the field is missing or empty.

Public method GetFirstBinary(string)

Returns the first binary value for the named field, or null when the field is missing or empty.

Public method GetValues(string)

Returns all string values for the named field, or an empty list.

Public method TryGetValues(string, out IReadOnlyList<string>)

Attempts to get all string values for the named field without treating a missing field as an empty collection.