From ef3e3cddddc43156f53958411f3396c9ef5dec60 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 15 Feb 2014 14:55:51 +0100 Subject: Only use the whole text as search snippet when it's the first match --- inc/fulltext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/fulltext.php') diff --git a/inc/fulltext.php b/inc/fulltext.php index bd8e6b866..fdaa1a19b 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -333,7 +333,7 @@ function ft_snippet($id,$highlight){ $pre = min($pre,100-$post); } else if ($post>50) { $post = min($post, 100-$pre); - } else { + } else if ($offset == 0) { // both are less than 50, means the context is the whole string // make it so and break out of this loop - there is no need for the // complex snippet calculations -- cgit v1.2.3