From cb084cec16158f5976b40a6ce8b474ec9da35509 Mon Sep 17 00:00:00 2001 From: Raman Saparkhan Date: Thu, 14 Sep 2023 22:01:16 +0300 Subject: [PATCH 1/4] minor fixes to poetry docs Signed-off-by: Raman Saparkhan --- samples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ``` From 0fc7a5434192f1c36c902569c2d21fcdc7e32afe Mon Sep 17 00:00:00 2001 From: Raman Saparkhan Date: Thu, 14 Sep 2023 22:14:25 +0300 Subject: [PATCH 2/4] updated CHANGELOG.md Signed-off-by: Raman Saparkhan --- CHANGELOG.md | 1 + guides/plugins/knn.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 040fb8ab..ce62b0d8 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 issue on Windows 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}} From ad8cc2a55853f186f64c0f1524a11341b5e95e86 Mon Sep 17 00:00:00 2001 From: Raman Saparkhan Date: Thu, 14 Sep 2023 22:23:16 +0300 Subject: [PATCH 3/4] updated CHANGELOG.md Signed-off-by: Raman Saparkhan --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce62b0d8..9a7d8323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +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 issue on Windows machines ([#494](https://github.com/opensearch-project/opensearch-py/pull/494)) +- Fixed poetry run command issue ([#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 From dcea6531cf294d60add3af8c5784a4e1ef7d574e Mon Sep 17 00:00:00 2001 From: Raman Saparkhan Date: Thu, 14 Sep 2023 22:37:49 +0300 Subject: [PATCH 4/4] fixed CHANGELOG.md Signed-off-by: Raman Saparkhan --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7d8323..762f2f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +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 ([#494](https://github.com/opensearch-project/opensearch-py/pull/494)) +- 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