Scc 5348, 5353, 5354#731
Conversation
There was a problem hiding this comment.
Nit. These aren't really fixtures, are they?
There was a problem hiding this comment.
Hmm perhaps I am using that term incorrectly. What would you call them?
There was a problem hiding this comment.
To my mind, fixtures are the static data you initialize the system with to ensure your input has a consistent output. They are the data you use to stabalize the parts of the system you're not testing so that you can focus on the part you are testing by making assertions about specific inputs having specific outputs. Seems like you just want to maintain your set of expectations in a different file from the tests, but that doesn't make them fixtures. They're the interesting parts, actually. Maybe just "cql generated es queries"?
| ] | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
- These are the original marc subfield tags? Why restrict to these? Is it not possible to do a
enclosesmatch on anetagged date - or any other non-null date for that matter?
There was a problem hiding this comment.
Per Sean encloses should only match bibs with date range types
| 'parallelSeriesAddedEntry.folded' | ||
| ], | ||
| exact_fields: [ | ||
| 'series', |
There was a problem hiding this comment.
these should be updated to *.keywordLowercasedStripped once the new es index is popuated. i can add it to my ticket to update discovery API
| .filter(fieldMatcher(queryTerm)) | ||
| .map(field => field.value) | ||
|
|
||
| if (matchingValues.length === 0) { |
There was a problem hiding this comment.
in what case would these values have length zero?
| const match = date.match(dateReg) | ||
| let rangeEnd | ||
| function nextDate (dateString) { | ||
| const dateRegex = /^(\d{4})(?:[-/](\d{2}))?(?:[-/](\d{2}))?$/ |
There was a problem hiding this comment.
seems like this method is responsible for validating dates. is there a specific case here that you're trying to account for? maybe you can pass the string into new Date() without regex crunching?
There was a problem hiding this comment.
I think this is the about all of the ES date range shenaningans, but i think some comments would help to describe the transformations you're making
seriesandgenreto match upcoming work in advanced search>should be greater than the entire date, i.e. gte the following date<=should be lte the entire date, i.e. lt the following datewithinis the same logic as<=InvalidQuerySyntaxErrorwhich triggers a 422 response in case of incorrect syntax