Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomarin committed Apr 14, 2023
2 parents 60b7906 + ef70529 commit 3ab34cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/pages/1_GPT_Smart_Search.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ def get_search_results(query, indexes):
agg_search_results = get_search_results(query, indexes)

file_content = OrderedDict()
content = dict()

try:
for search_results in agg_search_results:
for result in search_results['value']:
if result['@search.rerankerScore'] > 1: # Show results that are at least 25% of the max possible score=4
file_content[result['id']]={
content[result['id']]={
"title": result['title'],
"chunks": result['pages'],
"language": result['language'],
Expand All @@ -140,7 +141,10 @@ def get_search_results(query, indexes):
}
except:
st.markdown("Not data returned from Azure Search, check connection..")


#After results have been filtered we will Sort and add them as an Ordered list
for id in sorted(content, key= lambda x: content[x]["score"], reverse=True):
file_content[id] = content[id]

st.session_state["submit"] = True
# Output Columns
Expand Down

0 comments on commit 3ab34cc

Please sign in to comment.