| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Text.Json; |
| | 6 | |
|
| | 7 | | namespace Azure.Search.Documents |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Constants used by the Search client library. |
| | 11 | | /// </summary> |
| | 12 | | internal static class Constants |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Gets "*" to select all fields, properties, or rows. |
| | 16 | | /// </summary> |
| | 17 | | public const string All = "*"; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// The name of the API key header used for signing requests. |
| | 21 | | /// </summary> |
| | 22 | | public const string ApiKeyHeaderName = "api-key"; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Gets the representation of a NaN value. |
| | 26 | | /// </summary> |
| | 27 | | public const string NanValue = "NaN"; |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Gets the representation of positive infinity. |
| | 31 | | /// </summary> |
| | 32 | | public const string InfValue = "INF"; |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets the representation of negative infinity. |
| | 36 | | /// </summary> |
| | 37 | | public const string NegativeInfValue = "-INF"; |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// The prefix for special OData keys. |
| | 41 | | /// </summary> |
| | 42 | | public const string ODataKeyPrefix = "@"; |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// The @search.text key. |
| | 46 | | /// </summary> |
| 1 | 47 | | public static readonly JsonEncodedText SearchTextKeyJson = JsonEncodedText.Encode("@search.text"); |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// The @search.coverage key. |
| | 51 | | /// </summary> |
| 1 | 52 | | public static readonly JsonEncodedText SearchCoverageKeyJson = JsonEncodedText.Encode("@search.coverage"); |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// The @search.score key. |
| | 56 | | /// </summary> |
| 1 | 57 | | public static readonly JsonEncodedText SearchScoreKeyJson = JsonEncodedText.Encode("@search.score"); |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// The @search.facets key. |
| | 61 | | /// </summary> |
| 1 | 62 | | public static readonly JsonEncodedText SearchFacetsKeyJson = JsonEncodedText.Encode("@search.facets"); |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// The @search.nextPageParameters key. |
| | 66 | | /// </summary> |
| 1 | 67 | | public static readonly JsonEncodedText SearchNextPageKeyJson = JsonEncodedText.Encode("@search.nextPageParameter |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// The @search.highlights key. |
| | 71 | | /// </summary> |
| 1 | 72 | | public static readonly JsonEncodedText SearchHighlightsKeyJson = JsonEncodedText.Encode("@search.highlights"); |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// The @search.action key. |
| | 76 | | /// </summary> |
| 1 | 77 | | public static readonly JsonEncodedText SearchActionKeyJson = JsonEncodedText.Encode("@search.action"); |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// The @odata.count key. |
| | 81 | | /// </summary> |
| 1 | 82 | | public static readonly JsonEncodedText ODataCountKeyJson = JsonEncodedText.Encode("@odata.count"); |
| | 83 | |
|
| | 84 | | /// <summary> |
| | 85 | | /// The @odata.nextLink key. |
| | 86 | | /// </summary> |
| 1 | 87 | | public static readonly JsonEncodedText ODataNextLinkKeyJson = JsonEncodedText.Encode("@odata.nextLink"); |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// The name key. |
| | 91 | | /// </summary> |
| | 92 | | public const string NameKey = "name"; |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// The value key. |
| | 96 | | /// </summary> |
| | 97 | | public const string ValueKey = "value"; |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// The value key. |
| | 101 | | /// </summary> |
| 1 | 102 | | public static readonly JsonEncodedText ValueKeyJson = JsonEncodedText.Encode(ValueKey); |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// The count key. |
| | 106 | | /// </summary> |
| | 107 | | public const string CountKey = "count"; |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// The count key. |
| | 111 | | /// </summary> |
| 1 | 112 | | public static readonly JsonEncodedText CountKeyJson = JsonEncodedText.Encode(CountKey); |
| | 113 | |
|
| | 114 | | /// <summary> |
| | 115 | | /// The to key. |
| | 116 | | /// </summary> |
| | 117 | | public const string FromKey = "from"; |
| | 118 | |
|
| | 119 | | /// <summary> |
| | 120 | | /// The from key. |
| | 121 | | /// </summary> |
| | 122 | | public const string ToKey = "to"; |
| | 123 | |
|
| | 124 | | /// <summary> |
| | 125 | | /// The default recursion limit if we don't get a value from |
| | 126 | | /// <see cref="System.Text.Json.JsonSerializerOptions.MaxDepth"/>. |
| | 127 | | /// The service limit is (currently) 10. |
| | 128 | | /// </summary> |
| | 129 | | public const int MaxJsonRecursionDepth = 64; |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// The default size of buffer to use when copying data between streams. |
| | 133 | | /// </summary> |
| | 134 | | public const int CopyBufferSize = 81920; |
| | 135 | | } |
| | 136 | | } |