|  | 
|  | 1 | +using System; | 
|  | 2 | +using System.Text.Json.Serialization; | 
|  | 3 | + | 
|  | 4 | +namespace Meilisearch | 
|  | 5 | +{ | 
|  | 6 | +    /// <summary> | 
|  | 7 | +    /// Search query for similar documents. | 
|  | 8 | +    /// </summary> | 
|  | 9 | +    public class SimilarDocumentsQuery | 
|  | 10 | +    { | 
|  | 11 | +        /// <summary> | 
|  | 12 | +        /// Creates a new instance of the <see cref="SimilarDocumentsQuery"/> class. | 
|  | 13 | +        /// </summary> | 
|  | 14 | +        /// <param name="id"></param> | 
|  | 15 | +        public SimilarDocumentsQuery(string id) | 
|  | 16 | +        { | 
|  | 17 | +            if (string.IsNullOrEmpty(id)) | 
|  | 18 | +            { | 
|  | 19 | +                throw new ArgumentNullException(nameof(id)); | 
|  | 20 | +            } | 
|  | 21 | + | 
|  | 22 | +            Id = id; | 
|  | 23 | +        } | 
|  | 24 | + | 
|  | 25 | +        /// <summary> | 
|  | 26 | +        /// Gets the document id. | 
|  | 27 | +        /// </summary> | 
|  | 28 | +        [JsonPropertyName("id")] | 
|  | 29 | +        public string Id { get; } | 
|  | 30 | + | 
|  | 31 | +        /// <summary> | 
|  | 32 | +        /// Gets or sets the embedder. | 
|  | 33 | +        /// </summary> | 
|  | 34 | +        [JsonPropertyName("embedder")] | 
|  | 35 | +        public string Embedder { get; set; } | 
|  | 36 | + | 
|  | 37 | +        /// <summary> | 
|  | 38 | +        /// Gets or sets the attributes to retrieve. | 
|  | 39 | +        /// </summary> | 
|  | 40 | +        [JsonPropertyName("attributesToRetrieve")] | 
|  | 41 | +        public string[] AttributesToRetrieve { get; set; } = { "*" }; | 
|  | 42 | + | 
|  | 43 | +        /// <summary> | 
|  | 44 | +        /// Gets or sets the offset. | 
|  | 45 | +        /// </summary> | 
|  | 46 | +        [JsonPropertyName("offset")] | 
|  | 47 | +        public int Offset { get; set; } = 0; | 
|  | 48 | + | 
|  | 49 | +        /// <summary> | 
|  | 50 | +        /// Gets or sets the limit. | 
|  | 51 | +        /// </summary> | 
|  | 52 | +        [JsonPropertyName("limit")] | 
|  | 53 | +        public int Limit { get; set; } = 20; | 
|  | 54 | + | 
|  | 55 | +        /// <summary> | 
|  | 56 | +        /// Gets or sets the filter. | 
|  | 57 | +        /// </summary> | 
|  | 58 | +        [JsonPropertyName("filter")] | 
|  | 59 | +        public string Filter { get; set; } | 
|  | 60 | + | 
|  | 61 | +        /// <summary> | 
|  | 62 | +        /// Gets or sets whether to show the ranking score. | 
|  | 63 | +        /// </summary> | 
|  | 64 | +        [JsonPropertyName("showRankingScore")] | 
|  | 65 | +        public bool ShowRankingScore { get; set; } | 
|  | 66 | + | 
|  | 67 | +        /// <summary> | 
|  | 68 | +        /// Gets or sets whether to show the ranking score details. | 
|  | 69 | +        /// </summary> | 
|  | 70 | +        [JsonPropertyName("showRankingScoreDetails")] | 
|  | 71 | +        public bool ShowRankingScoreDetails { get; set; } | 
|  | 72 | + | 
|  | 73 | +        /// <summary> | 
|  | 74 | +        /// Gets or sets the ranking score threshold. | 
|  | 75 | +        /// </summary> | 
|  | 76 | +        [JsonPropertyName("rankingScoreThreshold")] | 
|  | 77 | +        public int? RankingScoreThreshold { get; set; } | 
|  | 78 | + | 
|  | 79 | +        /// <summary> | 
|  | 80 | +        /// Gets or sets whether to retrieve the vectors. | 
|  | 81 | +        /// </summary> | 
|  | 82 | +        [JsonPropertyName("retrieveVectors")] | 
|  | 83 | +        public bool RetrieveVectors { get; set; } | 
|  | 84 | +    } | 
|  | 85 | +} | 
0 commit comments