Browse Source

remove unnecessary modules now that the crawler is separate

master
wes 7 years ago
parent
commit
32d3f6e4b0
  1. 20
      src/goasearch.py
  2. 39
      src/mapping.py
  3. 0
      src/mcmaster/classes.csv

20
src/goasearch.py

@ -1,20 +0,0 @@
#! /usr/bin/python3
from search import indexListing
from textbookExceptions import UnIndexable
from mcmaster.classes import allCourses
from search import indexListing, createIndex
from itertools import imap
try:
print("Trying to create the index if it does not exist already")
createIndex("oersearch")
except Exception as e:
print(e)
print("Downloading course info")
for c in allCourses():
try:
print(c)
print(indexListing(c))
except UnIndexable as e:
print(e)

39
src/mapping.py

@ -1,39 +0,0 @@
#! /usr/bin/python2
from elasticsearch_dsl import DocType, Date, Nested, Boolean, \
analyzer, InnerObjectWrapper, Completion, Keyword, Text, Object
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=["localhost"])
class TextBook(InnerObjectWrapper):
pass
class Section(InnerObjectWrapper):
pass
class Course(DocType):
textbook = Object(
doc_class=TextBook,
properties = {
"author" : Text(),
"title" : Text(),
"price" : Text()
}
)
sections = Object(
doc_class=Section,
properties = {
"sem" : Keyword(),
"title" : Text(),
"prof" : Text(),
"loc" : Text(),
"time" : Text(),
"day" : Text()
}
)
class Meta:
index = "course_test"

0
src/mcmaster/classes.csv

Loading…
Cancel
Save