cakiki commited on
Commit
a9b6215
·
1 Parent(s): db86a8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -23,16 +23,19 @@ if search_query or button_clicked:
23
  num_results = None
24
  #search_results = searcher.search(myquery, limit=num_results)
25
  search_results = searcher.search(search_query, k=10)
26
- st.write(search_results[0].raw)
27
  #st.write(f"<p align=\"right\" style=\"color:grey;\">Retrieved {len(search_results):,.0f} documents in {search_results.runtime*1000:.2f} ms</p>", unsafe_allow_html=True)
28
  for result in search_results[:10]:
29
  #keywords = ', '.join(result.key_terms('text'))
30
  #meta = result['meta']
31
  #st.write(f"<b>Document Keywords</b>: {keywords}", unsafe_allow_html=True)
32
- #st.write(f"<b>Meta Field</b>: {meta}", unsafe_allow_html=True)
 
 
 
33
  try:
34
  st.write(
35
- json.loads(result.raw["contents"]),
36
  unsafe_allow_html=True
37
  )
38
  except:
 
23
  num_results = None
24
  #search_results = searcher.search(myquery, limit=num_results)
25
  search_results = searcher.search(search_query, k=10)
26
+ #st.write(dir(search_results[0]))
27
  #st.write(f"<p align=\"right\" style=\"color:grey;\">Retrieved {len(search_results):,.0f} documents in {search_results.runtime*1000:.2f} ms</p>", unsafe_allow_html=True)
28
  for result in search_results[:10]:
29
  #keywords = ', '.join(result.key_terms('text'))
30
  #meta = result['meta']
31
  #st.write(f"<b>Document Keywords</b>: {keywords}", unsafe_allow_html=True)
32
+ result = json.loads(result.raw)
33
+ doc = result["contents"]
34
+ result_id = result["id"]
35
+ st.write(f"<b>Document ID</b>: {result_id}", unsafe_allow_html=True)
36
  try:
37
  st.write(
38
+ doc[:1000]),
39
  unsafe_allow_html=True
40
  )
41
  except: