CDRH / open-oni_nebraska_theme

Nebraska child theme for open-oni github.com/open-oni
0 stars 0 forks source link

adding "year range" to search results filters complicated initiative #17

Closed jduss4 closed 6 years ago

jduss4 commented 6 years ago

Hokay so! I was trying to add the year range filter to the page search results when I ran into a little bit of trouble. Let's start at the beginning.

In the original chronam (they have since removed filters entirely) and therefore in nebnews, the filters were fired off by jquery, so we were able to split the solr returned facets for year ranges into date1 and date2, added the year filter type, and they were handled by the back end code with no problem:

https://github.com/CDRH/nebnews/blob/master/nebraska/templates/search_pages_results.html#L183 https://github.com/CDRH/nebnews/blob/master/core/index.py#L442

HOWEVER in the new open oni, we are no longer using jquery to send the results, and so adding date filter code isn't actually doing much automatically.

I propose that we send the value of the year dropdown through as date1 and check the format in solr_index.py to parse it out OR we send through year and then know that year takes precedence over date1 and date2 (and perhaps even replaces them in the query params object). Thoughts?

This is going to be a chance to open oni core, but since the year filter is not in the core templates by default I figured we should think about it here before opening a pull request. if we do add this to core, then we should also go ahead and break that template up into smaller chunks so that oregon can override the page results to avoid year if they do not want it

jduss4 commented 6 years ago

I believe that this was resolved by the openoni #333 PR! yayy!