Browse Source

update root url

master
nisstyre56 9 years ago
parent
commit
b295cc5d16
  1. 4
      src/scripts/search.js
  2. 2
      src/scripts/search.tag
  3. 5
      src/search.py

4
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)

2
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);

5
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

Loading…
Cancel
Save