-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewable reports #357
Viewable reports #357
Changes from all commits
e1dd0e9
2538a1e
3819d6e
3620693
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -687,6 +687,8 @@ def search(self): | |
# Don't auto-escape my query! https://django-haystack.readthedocs.io/en/v2.4.1/searchqueryset_api.html#SearchQuerySet.filter | ||
sqs = sqs.filter_or(attachment_text=Raw(self.cleaned_data['q'])) | ||
|
||
sqs = sqs.filter(viewable=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we always hide bills, should we index them at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i.e., do we have all the info we need to omit them when we build the index?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i forget, does our current pipeline update the index with every scrape, or with enough frequency for this suggestion to make sense?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I asked myself this very question! I decided to index "hidden" bills for one reason – the integrity script, which checks that the Councilmatic database and the Solr index have the same number of bills. If we do not index a "hidden" bill, then this script will complain. I think it's easier to modify the SearchQuerySet, rather than find a workaround with how the integrity script or (N.B. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha, great minds. :-) that makes sense to me. maybe it would be good a drop a comment or docstring in the |
||
|
||
return sqs | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this array ever become very large? since we only care about the presence, but not how many, etc., it may be more memory-efficient to do something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this list will never be very large – a bill may be associated with one or two events. More than that does not align with what Metro has done historically.