Commit
c3259a517612d10d96f5a9ca016c4a4754daa397
Authored by
Luan
Exists in
master
and in
39 other branches
1.12.x, add_requests_as_dep, celery_service, change-passwd-signal, check-port, colab-signals, colab-vcard, colab_search, colab_tag, colab_tag_merge, community_association, detach_super_archives, fix-dashboard, fix-message-preview, fix_app_label, fix_cache_count_spb, fix_header, fixed_gitlab_import, go_to_profile_panel, header_footer, layout-fix, mobile_user_scalable, move_out_plugins, paginate-threads, profile_integration, refactor-data-import, remove-gitlab-plugin, removing_namespace, search_block, search_filters, spb-release/3.0, split_screen, stable, startplugin, timestamp_plugins, translation_review, user_regex, validate-passwd, workin_whoosh_temp
Adding custom highlighter
| @@ -15,6 +15,8 @@ LANGUAGES = ( |
| @@ -15,6 +15,8 @@ LANGUAGES = ( |
15
| |
15
| |
16
| LANGUAGE_CODE = 'pt-br' |
16
| LANGUAGE_CODE = 'pt-br' |
17
| |
17
| |
| |
18
| +HAYSTACK_CUSTOM_HIGHLIGHTER = 'colab.utils.highlighting.ColabHighlighter' |
| |
19
| + |
18
| HAYSTACK_CONNECTIONS = { |
20
| HAYSTACK_CONNECTIONS = { |
19
| 'default': { |
21
| 'default': { |
20
| 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', |
22
| 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', |
| @@ -0,0 +1,6 @@ |
| @@ -0,0 +1,6 @@ |
| |
1
| +from haystack.utils import Highlighter |
| |
2
| + |
| |
3
| + |
| |
4
| +class ColabHighlighter(Highlighter): |
| |
5
| + def find_window(self, highlight_locations): |
| |
6
| + return (0, self.max_length) |
| @@ -369,3 +369,8 @@ ul.emails { |
| @@ -369,3 +369,8 @@ ul.emails { |
369
| } |
369
| } |
370
| |
370
| |
371
| /* end user profile update */ |
371
| /* end user profile update */ |
| |
372
| + |
| |
373
| +/* search highlighting */ |
| |
374
| +span.highlighted { |
| |
375
| + background-color: yellow; |
| |
376
| +} |