diff --git a/dotnet/src/Connectors/VectorData.Abstractions/VectorSearch/HybridSearchOptions.cs b/dotnet/src/Connectors/VectorData.Abstractions/VectorSearch/HybridSearchOptions.cs index 34d5b03d7f78..65a8a025207b 100644 --- a/dotnet/src/Connectors/VectorData.Abstractions/VectorSearch/HybridSearchOptions.cs +++ b/dotnet/src/Connectors/VectorData.Abstractions/VectorSearch/HybridSearchOptions.cs @@ -10,6 +10,8 @@ namespace Microsoft.Extensions.VectorData; /// public class HybridSearchOptions { + private int _skip = 0; + /// /// Gets or sets a search filter to use before doing the hybrid search. /// @@ -42,9 +44,22 @@ public class HybridSearchOptions public Expression>? AdditionalProperty { get; init; } /// - /// Gets or sets the number of results to skip before returning results, i.e. the index of the first result to return. + /// Gets or sets the number of results to skip before returning results, that is, the index of the first result to return. /// - public int Skip { get; init; } = 0; + /// Thrown when the value is less than 0. + public int Skip + { + get => this._skip; + init + { + if (value < 0) + { + throw new ArgumentOutOfRangeException(nameof(value), "Skip must be greater than or equal to 0."); + } + + this._skip = value; + } + } /// /// Gets or sets a value indicating whether to include vectors in the retrieval result.