diff --git a/course.json b/course.json index 298a708..d491bd7 100644 --- a/course.json +++ b/course.json @@ -1 +1 @@ -{"course":{"properties":{"textbooks":{"properties":{"author":{"type":"string","index":"analyzed"},"price":{"type":"string","index":"analyzed"},"title":{"type":"string","index":"analyzed"}}},"sections":{"properties":{"time":{"type":"string","index":"analyzed"},"title":{"type":"string","index":"analyzed"},"loc":{"type":"string","index":"analyzed"},"prof":{"type":"string","index":"analyzed"},"sem":{"type":"string","index":"analyzed"},"day":{"type":"string","index":"analyzed"}}}}}} +{"course":{"properties":{"textbooks":{"properties":{"author":{"type":"string","index":"analyzed"},"title":{"type":"string","index":"analyzed"},"price":{"type":"string","index":"analyzed"}}},"sections":{"properties":{"sem":{"type":"string","index":"not_analyzed"},"title":{"type":"string","index":"analyzed"},"prof":{"type":"string","index":"analyzed"},"loc":{"type":"string","index":"analyzed"},"time":{"type":"string","index":"analyzed"},"day":{"type":"string","index":"analyzed"}}}}}} diff --git a/course_mapping.rkt b/course_mapping.rkt index 65a1e2e..fd52bb5 100755 --- a/course_mapping.rkt +++ b/course_mapping.rkt @@ -10,7 +10,7 @@ ,(str "time") ,(str "loc") ,(str "prof") - ,(str "sem") + ,(atom "sem") ,(str "day"))) ,(estruct "textbooks" diff --git a/schemadsl.rkt b/schemadsl.rkt index 667f371..c84baab 100644 --- a/schemadsl.rkt +++ b/schemadsl.rkt @@ -36,6 +36,8 @@ (define str (prop "string")) +(define atom (prop "string" "not_analyzed")) + (define num (prop "integer")) (define date (prop "date")) diff --git a/src/scripts/search.js b/src/scripts/search.js index 4fb0e1f..78be934 100644 --- a/src/scripts/search.js +++ b/src/scripts/search.js @@ -76,11 +76,12 @@ function filterCourses(courses) { return R.filter( function (c) { - return c.prof != "Staff"; + return c.prof != "Staff" && c.sem == "Winter"; }, courses); } function groupsof(n, xs) { + /* Chunk a list into groups of n size */ return R.unfold( function(xs) { if (R.length(xs) > 0) { diff --git a/src/search.py b/src/search.py index 8c67220..7e983bc 100755 --- a/src/search.py +++ b/src/search.py @@ -136,6 +136,12 @@ def search(field): return q return s +def filterSem(term): + return Q("terms", + **{ + "sem" : [term] + }) + def join(x, y): """ Join two queries @@ -178,6 +184,7 @@ def searchTerms(terms): .query(q))[0:100] # only return up to 100 results for now results = s.execute() + syslog(repr(results)) filtered = [ (secs, filterSections(secs)[0].to_dict()) # get rid of tutorials @@ -213,5 +220,5 @@ searchers = { "loc" : search("loc"), "time" : search("time"), "prof" : search("prof"), - "day" : search("day"), + "day" : search("day") } diff --git a/src/styles/search.scss b/src/styles/search.scss index 28655fa..dcdb1be 100644 --- a/src/styles/search.scss +++ b/src/styles/search.scss @@ -46,7 +46,7 @@ a { } .courses { - + margin-bottom: 50px; @media (min-width: 1335px) { margin-top: 20px; max-width: 75%;