fix: crop search snippets to 30 words around match
This commit is contained in:
parent
7d4c7eea95
commit
2b287ccb35
@ -34,6 +34,8 @@ class SearchClient:
|
|||||||
"attributesToHighlight": ["content"],
|
"attributesToHighlight": ["content"],
|
||||||
"highlightPreTag": "<em>",
|
"highlightPreTag": "<em>",
|
||||||
"highlightPostTag": "</em>",
|
"highlightPostTag": "</em>",
|
||||||
|
"attributesToCrop": ["content"],
|
||||||
|
"cropLength": 30,
|
||||||
})
|
})
|
||||||
results = []
|
results = []
|
||||||
for hit in response.get("hits", []):
|
for hit in response.get("hits", []):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user