Skip to content

Commit e570bfd

Browse files
add link to menu, include usage guidelines
1 parent 64bf93b commit e570bfd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@
360360
"reference/api/metrics",
361361
"reference/api/logs",
362362
"reference/api/export",
363-
"reference/api/webhooks"
363+
"reference/api/webhooks",
364+
"reference/api/compact"
364365
]
365366
},
366367
{

reference/api/compact.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ import CodeSamplesCompactIndex1 from '/snippets/samples/code_samples_compact_ind
99

1010
Index fragmentation occurs naturally as you use Meilisearch and can lead to decreased performance over time. `/compact` reorganizes the database and prunes unused space, which may lead to improved indexing and search speeds.
1111

12+
Meilisearch Cloud monitors database fragmentation and compacts indexes as needed. Self-hosted users may have to build a pipeline to periodically indexes and fix performance degradation.
13+
1214
<Tip>
13-
To obtain a rough estimate of your index's fragmentation, query the `/stats` route and compute the ratio between `databaseSize` and `usedDatabaseSize`. If the ratio is >= X.Y, compacting your indexes may improve performance.
15+
Fragmentation is directly related to the number of indexing operations Meilisearch performs. Common indexing operations include adding and updating documents, as well as changes to index settings.
16+
17+
To estimate your index's fragmentation, query the `/stats` route. If the ratio between `databaseSize` and `usedDatabaseSize` is bigger than 30%, compacting your indexes may improve performance.
18+
19+
If you update documents in your indexes a few times per day, you may benefit from checking fragmentation and compacting your database once per week. If indexing load is very high, compacting indexes multiple times per week may be necessary to ensure optimal performance.
1420
</Tip>
1521

1622
## Compact database

0 commit comments

Comments
 (0)