From b295cc5d16b727bbe322cb7a44ea44601665130a Mon Sep 17 00:00:00 2001 From: nisstyre56 Date: Mon, 20 Jun 2016 22:56:37 +0000 Subject: [PATCH] update root url --- src/scripts/search.js | 4 +++- src/scripts/search.tag | 2 +- src/search.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/scripts/search.js b/src/scripts/search.js index f40ebe1..410e81a 100644 --- a/src/scripts/search.js +++ b/src/scripts/search.js @@ -1,3 +1,5 @@ +var root = "mgoal.ca/search"; + function makeResourceGetter(self) { function getResources(ev) { ev.preventDefault(); @@ -7,7 +9,7 @@ function makeResourceGetter(self) { "title" : this.booktitle, "author" : this.bookauthor }; - var url = "http://localhost:8001/resources"; + var url = "http://"+root+"/resources"; console.log(params); $.getJSON(url, { data : JSON.stringify(params) diff --git a/src/scripts/search.tag b/src/scripts/search.tag index cdc3f9f..a23a074 100644 --- a/src/scripts/search.tag +++ b/src/scripts/search.tag @@ -21,7 +21,7 @@ function submit(ev) { console.log("submitted"); var params = $(ev.currentTarget).serialize(); - $.getJSON("http://localhost:8001/fc?"+params, + $.getJSON("http://"+root+"/fc?"+params, function(courses) { var fcourses = filterCourses(courses); var cgroups = groupsof(4, fcourses); diff --git a/src/search.py b/src/search.py index 777222f..a56e9d3 100755 --- a/src/search.py +++ b/src/search.py @@ -81,7 +81,7 @@ def createIndex(name): indices = elasticsearch.client.IndicesClient(es) print indices.create(name) - with open("./course.json", "r") as mapping: + with open("../course.json", "r") as mapping: print indices.put_mapping("course", loads(mapping.read()), name) def indexListing(course): @@ -230,8 +230,9 @@ searchers = { } #print searchTerms({"title" : "PHILOS"}) - +#createIndex("oersearch") #for c in imap(classToJSON, allCourses()): #try: #print indexListing(c) #except UnIndexable as e: + ##print e