Skip to content

Commit

Permalink
fix: improve message in case of an empty search result. (#346)
Browse files Browse the repository at this point in the history
Co-authored-by: nicain <[email protected]>
  • Loading branch information
2 people authored and dandhlee committed Dec 2, 2022
1 parent cc2c55f commit def22c1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def search():
search_response = SearchServiceClient().search(search_request)

print("---search response---")
print(search_response)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
return search_response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def search():
search_request = get_search_request("Tee", condition, boost)
search_response = SearchServiceClient().search(search_request)
print("---search response---")
print(search_response)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
return search_response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def search():
search_request = get_search_request("Tee", facet_key)
search_response = SearchServiceClient().search(search_request)
print("---search response---")
print(search_response)
print("---facets:---")
print(search_response.facets)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
print("---facets:---")
print(search_response.facets)
return search_response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def search():
search_request = get_search_request("Tee", filter_)
search_response = SearchServiceClient().search(search_request)
print("---search response---")
print(search_response)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
return search_response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def search():
search_response = SearchServiceClient().search(search_request)

print("---search response---")
print(search_response)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
return search_response


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def search():
search_response_first_page = SearchServiceClient().search(search_request_first_page)

print("---search response---")
print(search_response_first_page)
if not search_response_first_page.results:
print("The search operation returned no matching results.")
else:
print(search_response_first_page)

# PASTE CALL WITH NEXT PAGE TOKEN HERE:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def search():
search_response = SearchServiceClient().search(search_request)

print("---search response---")
print(search_response)
if not search_response.results:
print("The search operation returned no matching results.")
else:
print(search_response)
return search_response


Expand Down

0 comments on commit def22c1

Please sign in to comment.