datamade / nyc-council-councilmatic

NYC Council version of Councilmatic
MIT License
8 stars 3 forks source link

Filter by sponsor has missing names #105

Closed derekeder closed 5 years ago

derekeder commented 6 years ago
  1. Go to the Legislation page: https://laws.council.nyc.gov/search/
  2. Click filter by sponsor
  3. The list of sponsors has redundant and missing names

Notably:

Not seeing this issue on the staging site: https://nyc-council-staging.datamade.us/search/

reginafcompton commented 6 years ago

I re-ran import_data and I rebuilt the index. This problem persists. The numbers seem odd, however:

The import: 36679 bills Rebuild index: 32123 bills

reginafcompton commented 6 years ago

Here's what I can glean, thus far:

We prepare a bill's sponsorships like so: https://github.com/datamade/django-councilmatic/blob/master/councilmatic_core/haystack_indexes.py#L47

I can see those sponsorships when I search the Solr interface....entering a bill sponsored by M. Chin in the "q" field (e.g., "Introduction 1062-2016").

However, the facets dict (extra['facets']['fields']['sponsorships']) in the CouncilmaticFacetedSearchField does not contain the all the sponsorships we expect - that is, it's missing M. Chin and others. This dict is important, since its what we show in the template: https://github.com/datamade/django-councilmatic/blob/master/councilmatic_core/templates/search/search.html#L88

Why is this dict incomplete? how is it getting generated?