Skip to content

Commit 0d3abb4

Browse files
committed
[bug 904443] Fix highlighting
This reinstates the "show the whole thing" highlighting. Because we're showing the whole field highlighted, "fragment_size" has no effect, so I nixed that. Additionally, there's no "discussion_content" field so I nixed that, too. On top of that, to prevent me from trying to fix this again in the future, I updated the comment so that it correctly represents what should be happening in the code.
1 parent b80bb07 commit 0d3abb4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kitsune/search/views.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,14 @@ def search(request, template=None):
295295
try:
296296
cleaned_q = cleaned['q']
297297

298-
# Set up the highlights
299-
# First 500 characters of content in one big fragment
298+
# Set up the highlights. Show the entire field highlighted.
300299
searcher = searcher.highlight(
301300
'question_content', # support forum
302-
'discussion_content', 'document_summary', # kb
301+
'document_summary', # kb
303302
'post_content', # contributor forum
304303
pre_tags=['<b>'],
305304
post_tags=['</b>'],
306-
number_of_fragments=1,
307-
fragment_size=500)
305+
number_of_fragments=0)
308306

309307
# Set up boosts
310308
searcher = searcher.boost(

0 commit comments

Comments
 (0)