llama-index-vector-stores-opensearch 0.1.9__py3-none-any.whl → 0.1.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llama-index-vector-stores-opensearch might be problematic. Click here for more details.
- llama_index/vector_stores/opensearch/base.py +8 -4
- {llama_index_vector_stores_opensearch-0.1.9.dist-info → llama_index_vector_stores_opensearch-0.1.10.dist-info}/METADATA +1 -1
- llama_index_vector_stores_opensearch-0.1.10.dist-info/RECORD +5 -0
- llama_index_vector_stores_opensearch-0.1.9.dist-info/RECORD +0 -5
- {llama_index_vector_stores_opensearch-0.1.9.dist-info → llama_index_vector_stores_opensearch-0.1.10.dist-info}/WHEEL +0 -0
|
@@ -239,12 +239,12 @@ class OpensearchVectorClient:
|
|
|
239
239
|
Returns:
|
|
240
240
|
Up to k docs closest to query_embedding
|
|
241
241
|
"""
|
|
242
|
-
|
|
242
|
+
pre_filter = self._parse_filters(filters)
|
|
243
|
+
if not pre_filter:
|
|
243
244
|
search_query = self._default_approximate_search_query(
|
|
244
245
|
query_embedding, k, vector_field=embedding_field
|
|
245
246
|
)
|
|
246
247
|
else:
|
|
247
|
-
pre_filter = self._parse_filters(filters)
|
|
248
248
|
# https://opensearch.org/docs/latest/search-plugins/knn/painless-functions/
|
|
249
249
|
search_query = self._default_painless_scripting_query(
|
|
250
250
|
query_embedding,
|
|
@@ -388,17 +388,20 @@ class OpensearchVectorClient:
|
|
|
388
388
|
)
|
|
389
389
|
params = {
|
|
390
390
|
"search_pipeline": self._search_pipeline,
|
|
391
|
-
"_source_excludes": ["embedding"],
|
|
392
391
|
}
|
|
393
392
|
else:
|
|
394
393
|
search_query = self._knn_search_query(
|
|
395
394
|
self._embedding_field, query_embedding, k, filters=filters
|
|
396
395
|
)
|
|
397
|
-
params =
|
|
396
|
+
params = None
|
|
398
397
|
|
|
399
398
|
res = await self._os_client.search(
|
|
400
399
|
index=self._index, body=search_query, params=params
|
|
401
400
|
)
|
|
401
|
+
|
|
402
|
+
return self._to_query_result(res)
|
|
403
|
+
|
|
404
|
+
def _to_query_result(self, res) -> VectorStoreQueryResult:
|
|
402
405
|
nodes = []
|
|
403
406
|
ids = []
|
|
404
407
|
scores = []
|
|
@@ -433,6 +436,7 @@ class OpensearchVectorClient:
|
|
|
433
436
|
ids.append(node_id)
|
|
434
437
|
nodes.append(node)
|
|
435
438
|
scores.append(hit["_score"])
|
|
439
|
+
|
|
436
440
|
return VectorStoreQueryResult(nodes=nodes, ids=ids, similarities=scores)
|
|
437
441
|
|
|
438
442
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
llama_index/vector_stores/opensearch/__init__.py,sha256=U1_XAkZb6zcskOk4s10NB8Tjs9AZRGdRQLzOGpbWdBA,176
|
|
2
|
+
llama_index/vector_stores/opensearch/base.py,sha256=LGXHRzcMVpvE-cb778I_W_I7wfGbLKgFQq9jR4OY6N8,19162
|
|
3
|
+
llama_index_vector_stores_opensearch-0.1.10.dist-info/METADATA,sha256=_-b77ZvNRypAK2awVaSGwoKqL3VdyS9SgpfVmyvmH1o,678
|
|
4
|
+
llama_index_vector_stores_opensearch-0.1.10.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
5
|
+
llama_index_vector_stores_opensearch-0.1.10.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
llama_index/vector_stores/opensearch/__init__.py,sha256=U1_XAkZb6zcskOk4s10NB8Tjs9AZRGdRQLzOGpbWdBA,176
|
|
2
|
-
llama_index/vector_stores/opensearch/base.py,sha256=KoDUhRZXknBXBiODovw_PgvtFFAhbdkT0hU9NpMYl4o,19141
|
|
3
|
-
llama_index_vector_stores_opensearch-0.1.9.dist-info/METADATA,sha256=r6OTnDiVcC9eU-mzDS_dxHjRd9Q7GM2mHNF7-oFuxOc,677
|
|
4
|
-
llama_index_vector_stores_opensearch-0.1.9.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
5
|
-
llama_index_vector_stores_opensearch-0.1.9.dist-info/RECORD,,
|
|
File without changes
|