diff --git a/src/colab/custom_settings.py b/src/colab/custom_settings.py index b297d41..cf40c21 100644 --- a/src/colab/custom_settings.py +++ b/src/colab/custom_settings.py @@ -15,6 +15,8 @@ LANGUAGES = ( LANGUAGE_CODE = 'pt-br' +HAYSTACK_CUSTOM_HIGHLIGHTER = 'colab.utils.highlighting.ColabHighlighter' + HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', diff --git a/src/colab/utils/__init__.py b/src/colab/utils/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/colab/utils/__init__.py diff --git a/src/colab/utils/highlighting.py b/src/colab/utils/highlighting.py new file mode 100644 index 0000000..f90f713 --- /dev/null +++ b/src/colab/utils/highlighting.py @@ -0,0 +1,6 @@ +from haystack.utils import Highlighter + + +class ColabHighlighter(Highlighter): + def find_window(self, highlight_locations): + return (0, self.max_length) diff --git a/src/static/css/screen.css b/src/static/css/screen.css index 96c47ee..6c8d701 100644 --- a/src/static/css/screen.css +++ b/src/static/css/screen.css @@ -369,3 +369,8 @@ ul.emails { } /* end user profile update */ + +/* search highlighting */ +span.highlighted { + background-color: yellow; +} -- libgit2 0.21.2