From ee559baf1c6d448acb56bccba7f20334b00edb32 Mon Sep 17 00:00:00 2001 From: timvisee Date: Fri, 13 Oct 2023 10:49:37 +0200 Subject: [PATCH] Update `with_payload` examples, also describe using an array directly --- .../content/documentation/concepts/search.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/qdrant-landing/content/documentation/concepts/search.md b/qdrant-landing/content/documentation/concepts/search.md index d31c9d17b..d4df819c5 100644 --- a/qdrant-landing/content/documentation/concepts/search.md +++ b/qdrant-landing/content/documentation/concepts/search.md @@ -209,7 +209,33 @@ client.search( ) ``` -Parameter `with_payload` might also be used to `include` or `exclude` specific fields only: +The parameter `with_payload` may also be used to scope to or filter out a +specific payload subset. You can specify an array of items to include. For +example, to include `city`: + +```http +POST /collections/{collection_name}/points/search + +{ + "vector": [0.2, 0.1, 0.9, 0.7], + "with_payload": ["city"] +} +``` + +```python +from qdrant_client import QdrantClient +from qdrant_client.http import models + +client = QdrantClient("localhost", port=6333) + +client.search( + collection_name="{collection_name}", + query_vector=[0.2, 0.1, 0.9, 0.7], + with_payload=["city"], +) +``` + +Or use `include` or `exclude` explicitly. For example, to exclude `city`: ```http POST /collections/{collection_name}/points/search