Skip to content

Commit 93636f5

Browse files
Merge #635
635: Add documents and embbedings database metrics to IndexStats r=curquiza a=Alirexaa # Pull Request ## Related issue Fixes #629 Fixes #628 ## What does this PR do? This pull request includes changes to the `IndexStats` class in the `Meilisearch` namespace to enhance its functionality by adding new properties. These changes aim to provide more detailed statistics about the indexed documents. ### Enhancements to `IndexStats` class: * [`src/Meilisearch/IndexStats.cs`](diffhunk://#diff-c1df1350b10dfcd3601aae24cd48feba5dce4686d1a03f38fa9a6b9dae852f21L11-R19): Added new properties `RawDocumentDbSize`, `AvgDocumentSize`, `NumberOfEmbeddedDocuments`, and `NumberOfEmbeddings` to the `IndexStats` class. These properties provide additional insights into the size and structure of the indexed documents. [[1]](diffhunk://#diff-c1df1350b10dfcd3601aae24cd48feba5dce4686d1a03f38fa9a6b9dae852f21L11-R19) [[2]](diffhunk://#diff-c1df1350b10dfcd3601aae24cd48feba5dce4686d1a03f38fa9a6b9dae852f21R39-R63) ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Alireza Baloochi <[email protected]>
2 parents 06da607 + 0788cc3 commit 93636f5

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/Meilisearch/IndexStats.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ namespace Meilisearch
88
/// </summary>
99
public class IndexStats
1010
{
11-
public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<string, int> fieldDistribution)
11+
public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<string, int> fieldDistribution, long rawDocumentDbSize, long avgDocumentSize, int numberOfEmbeddedDocuments, int numberOfEmbeddings)
1212
{
1313
NumberOfDocuments = numberOfDocuments;
1414
IsIndexing = isIndexing;
1515
FieldDistribution = fieldDistribution;
16+
RawDocumentDbSize = rawDocumentDbSize;
17+
AvgDocumentSize = avgDocumentSize;
18+
NumberOfEmbeddedDocuments = numberOfEmbeddedDocuments;
19+
NumberOfEmbeddings = numberOfEmbeddings;
1620
}
1721

1822
/// <summary>
@@ -32,5 +36,30 @@ public IndexStats(int numberOfDocuments, bool isIndexing, IReadOnlyDictionary<st
3236
/// </summary>
3337
[JsonPropertyName("fieldDistribution")]
3438
public IReadOnlyDictionary<string, int> FieldDistribution { get; }
39+
40+
/// <summary>
41+
/// Get the total size of the documents stored in Meilisearch
42+
/// </summary>
43+
[JsonPropertyName("rawDocumentDbSize")]
44+
public long RawDocumentDbSize { get; }
45+
46+
/// <summary>
47+
/// Get the total size of the documents stored in Meilisearch divided by the number of documents
48+
/// </summary>
49+
[JsonPropertyName("avgDocumentSize")]
50+
public long AvgDocumentSize { get; }
51+
52+
/// <summary>
53+
/// Get the number of document in index that contains at least one embedded representation
54+
/// </summary>
55+
[JsonPropertyName("numberOfEmbeddedDocuments")]
56+
public int NumberOfEmbeddedDocuments { get; }
57+
58+
59+
/// <summary>
60+
/// Get the total number of embeddings representation that exists in that indexes
61+
/// </summary>
62+
[JsonPropertyName("numberOfEmbeddings")]
63+
public int NumberOfEmbeddings { get; }
3564
}
3665
}

0 commit comments

Comments
 (0)