View Single Post
Old 03-21-2005, 02:16 AM   #3
schizmat
Green Mole
 
Join Date: Feb 2005
Posts: 2
Possible solution

Probably not the most elegant solution but, I added a line which seems to work:

$extract_content = substr($extract_content,$first_bold_spot,max(SNIPPET_DISPLAY_LENGTH, 2 * strlen($query_string)));

//addition begins:
$extract_content = substr($extract_content, strpos($extract_content, " ", 0) + 1, strrpos($extract_content, " ") - strpos($extract_content, " ", 0));
//addition ends

$extract .= ' ...'.phpdigHighlight($reg_strings,$extract_content).'... ';

This is in the search_function.php file only. As it works at the point of result output, I don't _think_ I need to change anything else?

(I've increased snippet length to help with the context, but knowing this particular client I doubt they'll be happy anyway! *shrugs)

Hope this is of use to someone. I guess that wrapping the line in an if statement and adding a config flag could allow this to be easily turn on and offable if it's a useful enough option...

Last edited by schizmat; 03-21-2005 at 02:20 AM.
schizmat is offline   Reply With Quote