feat(#245): added a setting to determine how many embeds references to display in results

This commit is contained in:
Simon Cambier
2024-09-27 13:53:57 +02:00
parent 983fa2120b
commit 372e40fe74
2 changed files with 22 additions and 1 deletions

View File

@@ -385,7 +385,7 @@ export class SearchEngine {
const embeds = this.plugin.embedsRepository
.getEmbeds(doc.path)
// Limit to 5 embeds
.slice(0, 5)
.slice(0, this.plugin.settings.maxEmbeds)
for (const embed of embeds) {
// Inject the embed in the content after index i
documents[++i] = await this.plugin.cacheManager.getDocument(embed)