Skip to content

Commit

Permalink
Fix ES query
Browse files Browse the repository at this point in the history
  • Loading branch information
uyencfi authored and zwliew committed Nov 18, 2024
1 parent d6cb27b commit 954ed9d
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions website/src/views/modules/ModuleFinderSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,27 @@ function getExamClashFilter(semester: Semester, examTimings: ExamTiming[]): Filt
// with exam1 iff (exam2.start < exam1.end) && (exam2.end > exam1.start)
const clashRanges = examTimings.map((exam1) => ({

Check warning on line 74 in website/src/views/modules/ModuleFinderSidebar.tsx

View check run for this annotation

Codecov / codecov/patch

website/src/views/modules/ModuleFinderSidebar.tsx#L74

Added line #L74 was not covered by tests
bool: {
must: {
range: {
'semesterData.examDate': {
lt: getEndTime(exam1.start, exam1.duration),
must: [
{
range: {
'semesterData.examDate': {
lt: getEndTime(exam1.start, exam1.duration),
},
},
},
script: {
{
script: {
source: `doc.containsKey['semesterData.examDate'] &&
doc.containsKey['semesterData.examDuration'] &&
ZonedDateTime.parse(doc['semesterData.examDate'].value).plusMinutes(doc['semesterData.examDuration].value).isAfter(ZonedDateTime.parse(params.exam1start))`,
params: {
exam1start: exam1.start,
script: {
source: `doc.containsKey('semesterData.examDate') &&
doc.containsKey('semesterData.examDuration') &&
doc['semesterData.examDate'].value.plusMinutes(doc['semesterData.examDuration'].value).isAfter(ZonedDateTime.parse(params.exam1start))`,
params: {
exam1start: exam1.start,
},
},
},
},
},
],
},
}));

Expand Down

0 comments on commit 954ed9d

Please sign in to comment.