Skip to content

Commit ad8a3cf

Browse files
committed
🩹 (highlights) Try to avoid too long fragments in fvh
1 parent 56af46d commit ad8a3cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

openaleph_search/query/highlight.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def get_highlighter(
1616
"phrase_limit": 256,
1717
"order": "score", # Best fragments first
1818
"boundary_scanner": "sentence", # Break at sentences
19-
"boundary_max_scan": 100, # better sentence detection
20-
"boundary_chars": ".,!?;", # Explicit sentence boundary characters
19+
"boundary_max_scan": 300, # better sentence detection
20+
"boundary_chars": ".,!?;\n|,{}", # Explicit boundary for csv/json raw text
2121
"no_match_size": 300, # Hard limit when no boundary found
22+
"fragmenter": "span", # More precise fragment boundaries
2223
# "pre_tags": ["<em class='highlight-content'>"],
2324
# "post_tags": ["</em>"],
2425
"max_analyzed_offset": 999999, # Handle large documents

0 commit comments

Comments
 (0)