Support Local Sites in search.

Review Request #7062 — Created March 14, 2015 and submitted

Information

Review Board
release-2.0.x
cc05769...

Reviewers

Review requests and users on Local Sites are now indexed. When
searching, the Local Site (or lack thereof) is taken into account, and
only the appropriate results will be returned.

There's a BaseSearchIndex that all other search indexes must subclass.
This takes care of storing information on the associated local site(s)
in a consistent manner, to ease search queries. If no local sites are
associated with the object being indexed, the list will consist of a
single item: 0. This value indicates no local sites, and is easy to
query. This replaces the need for a separate boolean field. Empty lists
cannot be used, since there's no way to filter on these in any
consistent way across search backends.

As part of this, I had to remove usage of Haystack's
search_view_factory, which doesn't accept URL arguments. We now have our
own wrapper view that constructs the RBSearchView.

This requires a full re-index.

On a non-local site, I tried searching for both non-local site review requests
and local site review requests. Only the ones not on a local site were returned.

I repeated the same test when searching on a local site. Only the ones on that
local site were returned.

Description From Last Updated

Blank line after this.

daviddavid

Blank line after this.

daviddavid

Col: 63 E703 statement ends with a semicolon

reviewbotreviewbot

How about combining these lines?

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/search/views.py
        reviewboard/search/urls.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/search/views.py
        reviewboard/search/urls.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
    
    
  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/search/indexes.py
        reviewboard/search/views.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
        reviewboard/accounts/search_indexes.py
        reviewboard/search/urls.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/search/indexes.py
        reviewboard/search/views.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
        reviewboard/accounts/search_indexes.py
        reviewboard/search/urls.py
    
    
  2. reviewboard/search/indexes.py (Diff revision 2)
     
     
    Show all issues
    Col: 63
     E703 statement ends with a semicolon
    
  3. 
      
david
  1. 
      
  2. reviewboard/accounts/search_indexes.py (Diff revision 2)
     
     
    Show all issues

    Blank line after this.

  3. reviewboard/search/indexes.py (Diff revision 2)
     
     
    Show all issues

    Blank line after this.

  4. reviewboard/search/views.py (Diff revision 2)
     
     
     
    Show all issues

    How about combining these lines?

    1. I thought about that, but it's kinda funky-looking with the double parens. I like it being more explicit, so it's clear what's going on here.

    2. Sure.

  5. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/search/indexes.py
        reviewboard/search/views.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
        reviewboard/accounts/search_indexes.py
        reviewboard/search/urls.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/search/indexes.py
        reviewboard/search/views.py
        reviewboard/reviews/search_indexes.py
        reviewboard/reviews/managers.py
        reviewboard/accounts/search_indexes.py
        reviewboard/search/urls.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (3757cbe)