| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 3 | | // license information. |
| | 4 | |
|
| | 5 | | namespace Microsoft.Azure.Search.Models |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// A single bucket of a range facet query result that reports the number of documents with a field value falling |
| | 9 | | /// within a particular range. |
| | 10 | | /// </summary> |
| | 11 | | /// <typeparam name="T"> |
| | 12 | | /// A type that matches the type of the field to which the facet was applied. Valid types include |
| | 13 | | /// <c cref="System.DateTimeOffset">DateTimeOffset</c>, <c cref="System.Double">Double</c>, and |
| | 14 | | /// <c cref="System.Int64">Int64</c> (long in C#, int64 in F#). |
| | 15 | | /// </typeparam> |
| | 16 | | public class RangeFacetResult<T> where T : struct |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Creates a new instance of the <c cref="RangeFacetResult{T}">RangeFacetResult</c> class. |
| | 20 | | /// </summary> |
| | 21 | | /// <param name="count">The approximate count of documents falling within the bucket described by this facet.</p |
| | 22 | | /// <param name="from">A value indicating the inclusive lower bound of the facet's range, or <c>null</c> to indi |
| | 23 | | /// no lower bound (for the first bucket).</param> |
| | 24 | | /// <param name="to">A value indicating the exclusive upper bound of the facet's range, or <c>null</c> to indica |
| | 25 | | /// no upper bound (for the last bucket).</param> |
| 48 | 26 | | public RangeFacetResult(long count, T? from, T? to) |
| | 27 | | { |
| 48 | 28 | | From = from; |
| 48 | 29 | | To = to; |
| 48 | 30 | | Count = count; |
| 48 | 31 | | } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Gets the approximate count of documents falling within the bucket described by this facet. |
| | 35 | | /// </summary> |
| 48 | 36 | | public long Count { get; } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Gets a value indicating the inclusive lower bound of the facet's range, or <c>null</c> to indicate that ther |
| | 40 | | /// no lower bound (for the first bucket). |
| | 41 | | /// </summary> |
| 48 | 42 | | public T? From { get; } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Gets a value indicating the exclusive upper bound of the facet's range, or <c>null</c> to indicate that ther |
| | 46 | | /// no upper bound (for the last bucket). |
| | 47 | | /// </summary> |
| 48 | 48 | | public T? To { get; } |
| | 49 | | } |
| | 50 | | } |