Skip to content

Commit 865f84f

Browse files
authored
Merge pull request #7 from Azure-Samples/zavaproductsignite
Add notebook versions of Python scripts
2 parents b23612b + 040cfea commit 865f84f

File tree

6 files changed

+762
-9
lines changed

6 files changed

+762
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ First, create the search index and upload the products by running:
5353
python zava_product_upload.py
5454
```
5555

56-
Then, explore the different search techniques with these Python scripts:
56+
Then, explore the different search techniques with these Python scripts or notebooks:
5757

58-
* [Keyword Search](./zava_search_keyword.py)
59-
* [Vector Search](./zava_search_vector.py)
60-
* [Hybrid Search with RRF](./zava_search_rrf.py)
61-
* [Hybrid Search with RRF + Reranker](./zava_search_reranker.py)
58+
* [Keyword Search](./zava_search_keyword.py) | [Notebook](./zava_search_keyword.ipynb)
59+
* [Vector Search](./zava_search_vector.py) | [Notebook](./zava_search_vector.ipynb)
60+
* [Hybrid Search with RRF](./zava_search_rrf.py) | [Notebook](./zava_search_rrf.ipynb)
61+
* [Hybrid Search with RRF + Reranker](./zava_search_reranker.py) | [Notebook](./zava_search_reranker.ipynb)

render_table.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from rich.table import Table
77

88

9-
def render_product_results(results: list[dict[str, Any]], title: str, show_reranker: bool = False) -> None:
9+
def render_product_results(results: list[dict[str, Any]], title: str = "", show_reranker: bool = False) -> None:
1010
"""Render product search results as a rich table.
1111
1212
Args:
@@ -21,10 +21,9 @@ def render_product_results(results: list[dict[str, Any]], title: str, show_reran
2121
if show_reranker:
2222
table.add_column("Reranker", justify="right", style="red", width=8)
2323
table.add_column("Name", style="magenta", width=25)
24-
table.add_column("Description", style="white", width=50)
24+
table.add_column("Description", style="black", width=50)
2525
table.add_column("Categories", style="blue", width=20)
2626
table.add_column("Price", justify="right", style="yellow", width=8)
27-
table.add_column("SKU", style="green", width=12)
2827

2928
for doc in list(results):
3029
row = [
@@ -38,7 +37,6 @@ def render_product_results(results: list[dict[str, Any]], title: str, show_reran
3837
doc["description"][:80] + "..." if len(doc["description"]) > 80 else doc["description"],
3938
", ".join(doc["categories"]),
4039
f"${doc['price']:.2f}",
41-
doc["sku"],
4240
]
4341
)
4442
table.add_row(*row)

0 commit comments

Comments
 (0)