mirror of
https://github.com/Hopiu/xapian-haystack.git
synced 2026-04-30 03:24:56 +00:00
Changed highligting to not highlight any reserved words
This commit is contained in:
parent
c1fc676ecf
commit
33ed2ce8a9
1 changed files with 1 additions and 1 deletions
|
|
@ -513,7 +513,7 @@ class SearchBackend(BaseSearchBackend):
|
|||
`text` -- The text to be highlighted
|
||||
"""
|
||||
for term in [term.replace('*', '') for term in text.split()]:
|
||||
if term not in ('AND','OR'):
|
||||
if term not in self.RESERVED_WORDS:
|
||||
term_re = re.compile(re.escape(term), re.IGNORECASE)
|
||||
content = term_re.sub('<%s>%s</%s>' % (tag, term, tag), content)
|
||||
return content
|
||||
|
|
|
|||
Loading…
Reference in a new issue