taishi-i commited on
Commit
d7b79eb
1 Parent(s): 77f0fd7

update app.py

Browse files
Files changed (2) hide show
  1. app.py +8 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -77,10 +77,15 @@ class SearchApplication:
77
 
78
  for result in sorted(
79
  search_results,
80
- key=lambda x: json.loads(x.raw)["stargazers_count"],
81
- reverse=True
 
 
82
  ):
83
- data_json = json.loads(result.raw)
 
 
 
84
  description = data_json["description"]
85
  url = data_json["url"]
86
  project_name = data_json["project_name"]
 
77
 
78
  for result in sorted(
79
  search_results,
80
+ key=lambda x: json.loads(self.searcher.doc(x.docid).raw())[
81
+ "stargazers_count"
82
+ ],
83
+ reverse=True,
84
  ):
85
+ docid = result.docid
86
+ doc = self.searcher.doc(docid)
87
+ data_json = json.loads(doc.raw())
88
+
89
  description = data_json["description"]
90
  url = data_json["url"]
91
  project_name = data_json["project_name"]
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- pyserini==0.20.0
2
  faiss-cpu
3
  torch
4
  altair<5
 
1
+ pyserini
2
  faiss-cpu
3
  torch
4
  altair<5