From 2b287ccb3541f342ea006a26604a58a93c13383f Mon Sep 17 00:00:00 2001 From: Tianyang Date: Sat, 1 Aug 2026 19:27:07 +0800 Subject: [PATCH] fix: crop search snippets to 30 words around match --- backend/app/search_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/search_client.py b/backend/app/search_client.py index 5d561c2..f9f0bd1 100644 --- a/backend/app/search_client.py +++ b/backend/app/search_client.py @@ -34,6 +34,8 @@ class SearchClient: "attributesToHighlight": ["content"], "highlightPreTag": "", "highlightPostTag": "", + "attributesToCrop": ["content"], + "cropLength": 30, }) results = [] for hit in response.get("hits", []):