emory-libraries / dlp-lux

Discovery for the DLP Cor Repository
2 stars 0 forks source link

Unexpected behavior of "unknown" value in Date facet #611

Closed nikdragovic closed 4 years ago

nikdragovic commented 4 years ago

When clicking "unknown" from the homepage; a search results page is presented, but with the Featured Collections instead of the results for that query. The Date facet disappears from the facet list.

Destination from this action is: https://digital.library.emory.edu/?range%5Byear_for_lux_isim%5D%5Bmissing%5D=true

When clicking "unknown" from a search results page, the Date facet disappears from the facet list.

Destination from this action is: https://digital.library.emory.edu/?q=&range%5Byear_for_lux_isim%5D%5Bmissing%5D=true&search_field=common_fields&utf8=%E2%9C%93

Screen Shot 2020-05-20 at 9.14.07 AM.png Screen Shot 2020-05-20 at 9.15.52 AM.png

bwatson78 commented 4 years ago

@nikdragovic I have reached a solution that makes the "unknown" link work in both places mentioned and reliably supplies a constraint button on top. Unfortunately, the "Date" facet still disappears and remains gone until the "X" on the limiter is pressed. The Solr response provides us with an items array that only contains references to documents with the value populated. The only reference to documents with that field unpopulated is a number in the stats portion of that field object.

In order to have the date facet stay visible, there are two possible options:

  1. have Curate send an items object to Lux that encapsulates all documents that have that value missing, or
  2. have Lux create an items object whenever it iterates over the Solr response from curate,

Either way, I'd estimate 1.5 more days of work for coding and testing.

bwatson78 commented 4 years ago

@nikdragovic An example of what I'm referring to:

Screen Shot 2020-05-28 at 9.54.43 AM.png

rotated8 commented 4 years ago

After discussion, it appears the Date facet does not support "OR" querying, so having the the facet disappear when "unknown" is selected is correct behavior.

This is perhaps surprising compared to other facets, where you could select multiple, and an item that matched any of selections would show up in the results. With the date facet, once you apply a date range, the facet does not give you the ability to add another, only to update the one you set originally.

As an example, a user can, on the homepage, open the Date facet, change the range to 1800-2000, click apply, and see results. At that point, the current range can be shrunk using the sliders, or grown or shrunk using the text fields, but another range cannot be added. A user cannot search for works with dates between 1800-1825 OR 1850-1875. A side effect of this is that once a numeric range is specified, 'unknown' dates can no longer be added to the query either.

nikdragovic commented 4 years ago

Thanks @rotated8! Closing this bug ticket as @bwatson78 has satisfied the scope as written; we now have a potential enhancement.

bwatson78 commented 4 years ago

PR made: https://github.com/emory-libraries/dlp-lux/pull/615

Screen Shot 2020-05-28 at 9.54.43 AM.png