Skip to content

Commit 5f65286

Browse files
committed
Python SDK fix
1 parent d0f2f67 commit 5f65286

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/search/search-get-started-python.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: heidist
88
ms.service: cognitive-search
99
ms.devlang: python
1010
ms.topic: quickstart
11-
ms.date: 08/31/2022
11+
ms.date: 01/17/2023
1212
ms.custom: devx-track-python, mode-api
1313
---
1414

@@ -275,7 +275,7 @@ This step shows you how to query an index using the **search** method of the [se
275275
1. The following step executes an empty search (`search=*`), returning an unranked list (search score = 1.0) of arbitrary documents. Because there are no criteria, all documents are included in results. This query prints just two of the fields in each document. It also adds `include_total_count=True` to get a count of all documents (4) in the results.
276276

277277
```python
278-
results = search_client.search(search_text="*", include_total_count=True)
278+
results = search_client.search(search_text="*", include_total_count=True)
279279

280280
print ('Total Documents Matching Query:', results.get_count())
281281
for result in results:
@@ -285,7 +285,7 @@ This step shows you how to query an index using the **search** method of the [se
285285
1. The next query adds whole terms to the search expression ("wifi"). This query specifies that results contain only those fields in the `select` statement. Limiting the fields that come back minimizes the amount of data sent back over the wire and reduces search latency.
286286

287287
```python
288-
results = search_client.search(search_text="wifi", include_total_count=True, select='HotelId,HotelName,Tags')
288+
results = search_client.search(search_text="wifi", include_total_count=True, select='HotelId,HotelName,Tags')
289289

290290
print ('Total Documents Matching Query:', results.get_count())
291291
for result in results:
@@ -295,16 +295,16 @@ This step shows you how to query an index using the **search** method of the [se
295295
1. Next, apply a filter expression, returning only those hotels with a rating greater than 4, sorted in descending order.
296296

297297
```python
298-
results = search_client.search(search_text="hotels", select='HotelId,HotelName,Rating', filter='Rating gt 4', order_by='Rating desc')
298+
results = search_client.search(search_text="hotels", select='HotelId,HotelName,Rating', filter='Rating gt 4', order_by='Rating desc')
299299

300300
for result in results:
301301
print("{}: {} - {} rating".format(result["HotelId"], result["HotelName"], result["Rating"]))
302302
```
303303

304-
1. Add `search_fields` to scope query matching to a single field.
304+
1. Add `search_fields` (an array) to scope query matching to a single field.
305305

306306
```python
307-
results = search_client.search(search_text="sublime", search_fields='HotelName', select='HotelId,HotelName')
307+
results = search_client.search(search_text="sublime", search_fields=['HotelName'], select='HotelId,HotelName')
308308

309309
for result in results:
310310
print("{}: {}".format(result["HotelId"], result["HotelName"]))
@@ -313,7 +313,7 @@ This step shows you how to query an index using the **search** method of the [se
313313
1. Facets are labels that can be used to compose facet navigation structure. This query returns facets and counts for Category.
314314

315315
```python
316-
results = search_client.search(search_text="*", facets=["Category"])
316+
results = search_client.search(search_text="*", facets=["Category"])
317317

318318
facets = results.get_facets()
319319

0 commit comments

Comments
 (0)