thomasht86 commited on
Commit
79e03c6
·
verified ·
1 Parent(s): 0134a3f

deploy at 2024-08-24 11:06:08.474708

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -543,8 +543,10 @@ def get_yql(ranking: RankProfile, userquery: str) -> T[str, dict]:
543
 
544
  @app.get("/search")
545
  async def search(userquery: str, ranking: str, sess):
546
- print(sess)
 
547
  if "queries" not in sess:
 
548
  sess["queries"] = []
549
  quoted = quote(userquery) + "&ranking=" + ranking
550
  sess["queries"].append(quoted)
@@ -803,6 +805,8 @@ def get_about(auth, sess):
803
 
804
  @app.get("/document/{docid}")
805
  def get_document(docid: str, sess):
 
 
806
  resp = vespa_app.get_data(data_id=docid, schema="doc", namespace="tutorial")
807
  doc = resp.json
808
  # Link with Back to search results at top of page
 
543
 
544
  @app.get("/search")
545
  async def search(userquery: str, ranking: str, sess):
546
+ print("In search")
547
+ print(f"Session: {sess}")
548
  if "queries" not in sess:
549
+ print("Creating queries list")
550
  sess["queries"] = []
551
  quoted = quote(userquery) + "&ranking=" + ranking
552
  sess["queries"].append(quoted)
 
805
 
806
  @app.get("/document/{docid}")
807
  def get_document(docid: str, sess):
808
+ print(f"Getting document {docid}")
809
+ print(f"Session: {sess}")
810
  resp = vespa_app.get_data(data_id=docid, schema="doc", namespace="tutorial")
811
  doc = resp.json
812
  # Link with Back to search results at top of page