New class SearchHighlighter handles highlighting of search terms and
authorRobert Stojnić <rainman@users.mediawiki.org>
Thu, 1 May 2008 13:36:29 +0000 (13:36 +0000)
committerRobert Stojnić <rainman@users.mediawiki.org>
Thu, 1 May 2008 13:36:29 +0000 (13:36 +0000)
commit54dfb7b2cae4badef45b3e3a57f19c7826ed399c
tree84d4a3728f83f63dd9c85dc5376ee505243dd7bf
parentee4080ca16a04f40e9f94124ce79262f370f35ad
New class SearchHighlighter handles highlighting of search terms and
snippet extraction:
* prefer text hits over matches on images/templates/tables, making the
  snippets more readable and relevant
* cleanup wikitext
* prefer snippets with exact query match - works only for whole phrases
* drop the old context calculation and replace it will a more flexible one
  that does a better job keeping snippets of constant width
* if the first line of the article matches whole query show only one snippet
* manually lower/uppercase non-ascii chars so that words in e.g. cyrillic
  are also case-insensitive
* workaround for php limited utf8 support so that snippets end up being of
  constant char-size over single and multiple byte text
* if there is no text match for some reason, show beginning of the article
Warning:
* haven't done performance testing, might not be safe to go live, although
  I don't see any immediate problems with it
includes/SearchEngine.php