Skip to content

Commit 6fc81ef

Browse files
authored
add highlight results
1 parent ee78860 commit 6fc81ef

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

papermerge/search/documents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def update(
185185
parallel=False,
186186
**kwargs
187187
):
188+
188189
document_instance = thing.document
189190
DocumentIndex().update(
190191
document_instance,

papermerge/search/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def document_query(user_id, text, tags=[], tags_op=TAGS_OP_ALL):
9090
query_text
9191
).query(
9292
tags_query(clean_tags_list, tags_op)
93+
).highlight(
94+
'text', fragment_size=50
9395
)
9496

9597
return query

0 commit comments

Comments
 (0)