diff --git a/app/views/shared/_annotated_documents_search_results.html.erb b/app/views/shared/_annotated_documents_search_results.html.erb
index 5a9b69c..7aaa40c 100644
--- a/app/views/shared/_annotated_documents_search_results.html.erb
+++ b/app/views/shared/_annotated_documents_search_results.html.erb
@@ -33,14 +33,16 @@
<% end %>
<% documents.total_pages.times do |page| -%>
- <% if opts[:current_page].to_i.eql?(page + 1) %>
- <%= page + 1 %>
- <% else %>
-
- <%= page + 1 %>
-
+ <% if (page + 1) <= (opts[:current_page].to_i + 4) && (page + 1) >= (opts[:current_page].to_i - 4) %>
+ <% if opts[:current_page].to_i.eql?(page + 1) %>
+ <%= page + 1 %>
+ <% else %>
+
+ <%= page + 1 %>
+
+ <% end %>
<% end %>
<% end -%>
diff --git a/app/views/shared/_annotations_pagination.html.erb b/app/views/shared/_annotations_pagination.html.erb
index 3697169..11500de 100644
--- a/app/views/shared/_annotations_pagination.html.erb
+++ b/app/views/shared/_annotations_pagination.html.erb
@@ -10,43 +10,44 @@