NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
41 stars 26 forks source link

Consider a minor refactor of the Year filter in the Search sidebar #490

Open amoeba opened 6 years ago

amoeba commented 6 years ago

So @mpsaloha and I were talking in #arctica on Slack and he asked if it was possible to look for datasets uploaded after a specific date, e.g., 2018-02-1. I didn't think this was possible so I looked at the queries the Year section of the Search sidebar sends. When I check the "Publish year" box:

screen shot 2018-02-15 at 4 14 05 pm

The relevant part of the Solr query that's sent is:

datePublished:%5B1800-01-01T00%3A00%3A00Z%20TO%202017-12-31T00%3A00%3A00Z%5D%20OR%20dateUploaded:%5B1800-01-01T00%3A00%3A00Z%20TO%202017-12-31T00%3A00%3A00Z%5D)

which shows it's searching both datePublished and dateUploaded so it appears this does basically what's wanted. I also tested whether a specific day could be entered, rather than just a year, and it appears you can't (results in Solr error). @mpsaloha 's use case here would be to let a scientist see what's new, i.e., what's been uploaded in the last day/week/month. I think this is a pretty valid use case.

What do we think about a change or two:

At the very least, I found the current behavior a confusing because "Publish Year" queried both pubDate and dateUploaded.

laurenwalker commented 6 years ago

In the UI, we combine the concept of publication date (pubDate) and upload date (dateUploaded) since not all metadata docs have a pubDate specified. So querying only the pubDate would seem a bit too restrictive and too technical (i.e. some users may not understand the difference between an upload date and publish date).

This is also done in the citations - if there is no pubDate in the metadata, then the dateUploaded is used in the citation instead. So if we queried only for the pubDate, then some results would be filtered out that seemingly shouldn't be. For example, a dataset may have a citation with the year 2017 as the publication year because it was uploaded in 2017 and has no pubDate in the metadata. If a user filtered by pubDate == 2017, then that dataset would not be a result because technically, there is no pubDate value in the index.

I like the idea of using the precanned filters in a dropdown like the Reddit example.

Reducing the granularity to the day would be doable as well, if we decided users would use that feature.

amoeba commented 6 years ago

Right on, that all makes sense. Thanks for the detailed explanation!