From 29c6445dcce616f176f66118f07b4a776e5ee5c2 Mon Sep 17 00:00:00 2001 From: Raman Saparkhan <109868980+roma2023@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:07:52 +0300 Subject: [PATCH] [CCI][GUIDE] Minor fixes to poetry docs (#494) * minor fixes to poetry docs Signed-off-by: Raman Saparkhan * updated CHANGELOG.md Signed-off-by: Raman Saparkhan * updated CHANGELOG.md Signed-off-by: Raman Saparkhan * fixed CHANGELOG.md Signed-off-by: Raman Saparkhan --------- Signed-off-by: Raman Saparkhan --- CHANGELOG.md | 1 + guides/plugins/knn.md | 6 +++--- samples/README.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 040fb8ab..762f2f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Include parsed error info in `TransportError` in async connections ([#226](https://github.com/opensearch-project/opensearch-py/pull/226)) - Enhanced existing API generator to use OpenSearch OpenAPI spec ([#412](https://github.com/opensearch-project/opensearch-py/pull/412)) - Fix crash when attempting to authenticate with an async connection ([#424](https://github.com/opensearch-project/opensearch-py/pull/424)) +- Fixed poetry run command issue on Windows/Mac machines ([#494](https://github.com/opensearch-project/opensearch-py/pull/494)) ### Security - Fixed CVE-2022-23491 reported in opensearch-dsl-py ([#295](https://github.com/opensearch-project/opensearch-py/pull/295)) ### Dependencies diff --git a/guides/plugins/knn.md b/guides/plugins/knn.md index 7a3e6977..a7775c88 100644 --- a/guides/plugins/knn.md +++ b/guides/plugins/knn.md @@ -15,7 +15,7 @@ Short for k-nearest neighbors, the k-NN plugin enables users to search for the k In the following example we create a 5-dimensional k-NN index with random data. You can find a synchronous version of this working sample in [samples/knn/knn-basics.py](../../samples/knn/knn-basics.py) and an asynchronous one in [samples/knn/knn-async-basics.py](../../samples/knn/knn-async-basics.py). ```bash -$ poetry run knn/knn-basics.py +$ poetry run python knn/knn-basics.py Searching for [0.61, 0.05, 0.16, 0.75, 0.49] ... {'_index': 'my-index', '_id': '3', '_score': 0.9252405, '_source': {'values': [0.64, 0.3, 0.27, 0.68, 0.51]}} @@ -96,7 +96,7 @@ for hit in results["hits"]["hits"]: In [the boolean-filter.py sample](../../samples/knn/knn-boolean-filter.py) we create a 5-dimensional k-NN index with random data and a `metadata` field that contains a book genre (e.g. `fiction`). The search query is a k-NN search filtered by genre. The filter clause is outside the k-NN query clause and is applied after the k-NN search. ```bash -$ poetry run knn/knn-boolean-filter.py +$ poetry run python knn/knn-boolean-filter.py Searching for [0.08, 0.42, 0.04, 0.76, 0.41] with the 'romance' genre ... @@ -109,7 +109,7 @@ Searching for [0.08, 0.42, 0.04, 0.76, 0.41] with the 'romance' genre ... In [the lucene-filter.py sample](../../samples/knn/knn-efficient-filter.py) we implement the example in [the k-NN documentation](https://opensearch.org/docs/latest/search-plugins/knn/filter-search-knn/), which creates an index that uses the Lucene engine and HNSW as the method in the mapping, containing hotel location and parking data, then search for the top three hotels near the location with the coordinates `[5, 4]` that are rated between 8 and 10, inclusive, and provide parking. ```bash -$ poetry run knn/knn-efficient-filter.py +$ poetry run python knn/knn-efficient-filter.py {'_index': 'hotels-index', '_id': '3', '_score': 0.72992706, '_source': {'location': [4.9, 3.4], 'parking': 'true', 'rating': 9}} {'_index': 'hotels-index', '_id': '6', '_score': 0.3012048, '_source': {'location': [6.4, 3.4], 'parking': 'true', 'rating': 9}} diff --git a/samples/README.md b/samples/README.md index ad431cd8..b6e72f2c 100644 --- a/samples/README.md +++ b/samples/README.md @@ -15,5 +15,5 @@ Install [poetry](https://python-poetry.org/docs/). ``` poetry install -poetry run hello/hello.py +poetry run python hello/hello.py ```