Fix and improve searching for review requests.

Review Request #7057 — Created March 13, 2015 and submitted

Information

Review Board
release-2.0.x
9a65b15...

Reviewers

Our Haystack-based search, while easy to install, left much to be
desired. This change attempts to improve the overall experience of
searching for review requests in several ways.

First, the ordering of review requests are no longer left up to the
backend, as a relevance search isn't really that useful to our users.
Instead, we force the results to be ordered by the last updated
timestamp.

The review request IDs are now based on the display ID, instead of the
database ID, which will be necessary when we support Local Sites.

To improve performance, I've removed the load_all() call and the old
configurable limit we used to have for the maximum number of review
requests. I then added some fields we wanted to display in the results,
and updated the template to no longer access the database for these
objects, using the indexed data instead.

The paginator now has links for jumping to the very first and last page
(when there's a large number of pages), and for jumping to any page
within a given range. The logic for this was taken from the datagrid
code.

To complete the experience, I've made a few tweaks to the stylesheets,
massively improving the look of the search results.

Tested searching for various review requests with different pagination
results. Always saw the results sorted such that the most recently updated
review requests were first.

Tested editing the search settings, to ensure the form changes didn't break
anything.

Everything was tested with a fresh index.


reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/siteconfig.py
        reviewboard/admin/forms.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/views.py
    
    Ignored Files:
        reviewboard/static/rb/css/search.less
        reviewboard/templates/reviews/search.html
        reviewboard/templates/search/indexes/reviews/reviewrequest_text.txt
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/admin/siteconfig.py
        reviewboard/admin/forms.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/views.py
    
    Ignored Files:
        reviewboard/static/rb/css/search.less
        reviewboard/templates/reviews/search.html
        reviewboard/templates/search/indexes/reviews/reviewrequest_text.txt
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (cb37929)