Princeton-CDH / derrida-django

Derrida's Margins - Python/Django web application
https://derridas-margins.princeton.edu
Apache License 2.0
8 stars 1 forks source link

Facet counts report totals incorrectly for behavior (OR instead of AND) #220

Closed rlskoeser closed 6 years ago

rlskoeser commented 6 years ago

There's a Solr option to tell it to ignore a particular facet when generating counts. See https://github.com/Princeton-CDH/winthrop-django/blob/develop/winthrop/books/views.py#L127-L134 for how I implemented this for the Winthrop books search.

Applies to library, references, and interventions.

rlskoeser commented 6 years ago

More details from the Winthrop example. This is where filters are given a tag so they can be excluded: https://github.com/Princeton-CDH/winthrop-django/blob/develop/winthrop/books/views.py#L120-L125

And here is where we tell solr to exclude that tag: https://github.com/Princeton-CDH/winthrop-django/blob/develop/winthrop/books/views.py#L127-L133

rlskoeser commented 6 years ago

Tested library, references, and interventions page. Counts within each facet are now accurate and match the filtered results that display. Also working perfectly in combination - filtering by subject gives different author counts, selecting authors gives the correct count for each author independently.