-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #292 Date range queries #293
Conversation
This works for me except in the case when querying with an exact date that is a full 14 digit timestamp. In this case, with |
@ldko Thanks for testing I could change the code, if you would like to test if that change has any side effects. |
} | ||
return toString(datespec,url); | ||
|
||
String exactDateTimestamp = getEmptyStringIfNull(wbRequest.get(WaybackRequest.REQUEST_EXACT_DATE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60-68 should be indented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, but as a lot of other places in the code, it is a mixture of tabs and spaces.
If the change you would make is something like removing the
With the test failing on If we are not handling the 14 digit timestamp differently (by removing the elseif), then I noticed in the test though, the comment:
So I guess the expected behavior of an exact 14 digit timestamp search has been not to return a single date result (or none) as I was thinking, but to return all date range results with the closest one highlighted--though I can't tell how it is supposed to be highlighted looking at all the results. I guess the question is, do we want to only return an exact timestamp result if it actually matches the exact timestamp or do we want the functionality of what the comment indicates--that we return all matches and highlight the closest one--in which case we may need to better indicate the closest one. On another note, what do you think of adding some help text to the advanced search page? Something along the lines of (for English string) |
No, the change I suggest is in From: private final static Pattern TIMESTAMP_REGEX = Pattern.compile("(\\d{0,13})\\*"); To: private final static Pattern TIMESTAMP_REGEX = Pattern.compile("(\\d{0,14})\\*"); And then the test But I am not sure if this has any side effects. The rule will only be applied if the timestamp ends with |
Okay, that makes sense. You are changing it only for URL prefix queries and not exact URL queries. Your change works for the "beginning with" searches with 14 digit timestamps while the "exactly matching" searches still return all dates (which historically seems to be what is expected?). I didn't notice any side effects with allowing 14 digit timestamps with PathPrefixDatePrefixQueryRequestParser when using Archival replay. PathPrefixDatePrefixQueryRequestParser is also referenced in ProxyArchivalRequestParser, but honestly I'm not clear on how that should be used, so I can't tell if it is affected negatively. |
Fix for #292 Date range queries
This PR prevents the nullifying of start/end dates and also enables queries on exact dates.
The existing unit test required that both start and end date should be set, otherwise it treated it as none of them where set. I loosened that by allowing open-ended dates.
This PR renders #225 obsolete, and solves #292 and partially #190.