def query(uuid): # global q2emb if request.method == 'POST': content = request.json print("search string = ", content['todo_description']) print("You are getting search request") search_string = content['todo_description'] # json_dump = jsonify({"uuid": uuid}) # json_object = json_response({}) json_object = JFY({}) resultset = None if search.q2emb != None: json_result = search.search_query(postgres, search_string, 10) # json_result = json.dumps(json_result) json_object = JFY({"items": json_result}) print("json_results = ", json_object) else: print("Search Engine is not Valid") # jsonStr = json_response(json_object) # return jsonify(Results=jsonStr) print("response = ", json_object.get_json()) return json_object else: print("may be a GET request") return "may be a GET request"
def getmanualtag(uuid): if request.method == 'POST': print("You are getting getmanualtag request") content = request.json print("paragraph id = ", content) json_object = JFY({}) json_result = search.get_manualtag(postgres, content) json_object = JFY({"item": json_result}) print("json_results = ", json_object) print("response = ", json_object.get_json()) return json_object else: print("may be a GET request") return "may be a GET request"
def getdirectory(uuid): print("You are getting insert directory request") content = request.json json_result = search.get_directory_path(postgres) json_object = JFY({"items": json_result}) print("response for get_directory_path = ", json_object.get_json()) return json_object
def updatemanualtag(uuid): if request.method == 'POST': print("You are getting updatemanualtag request") content = request.json manualtag = content['manual_tag'] paraid = content['paraid'] print("update input = ", content) print("manualtag input = ", manualtag) print("paraid input = ", paraid) json_object = JFY({}) json_result = search.update_manualtag(postgres, paraid, manualtag) json_object = JFY({"updatedrows": json_result}) print("json_results = ", json_object) print("response = ", json_object.get_json()) return json_object else: print("may be a GET request") return "may be a GET request"
def getdirectorybyid(uuid): print("You are getting get directory by id request") content = request.json directoryid = content print("directoryid = ", directoryid) json_result = search.get_directory_path_byid(postgres, directoryid) json_object = JFY({"item": json_result}) print("json_results = ", json_object) print("response for get_directory_path_byid = ", json_object.get_json()) return json_object
def results(uuid): if request.method == 'POST': print("You are getting results request") json_result = search.get_results(postgres) json_object = JFY({"items": json_result}) print("json_results = ", json_object) print("response = ", json_object.get_json()) return json_object else: print("may be a GET request") return "may be a GET request"